From patchwork Wed Nov 27 07:21:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 180252 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5735493ilf; Tue, 26 Nov 2019 23:22:00 -0800 (PST) X-Google-Smtp-Source: APXvYqyNLVmEyBBjmX7Ot2589Id10DIxECQwBJ/l08oTT9aq0k+no3VGps9G3/aVMf9nOa1Y8d5d X-Received: by 2002:a05:6402:282:: with SMTP id l2mr31019835edv.187.1574839320470; Tue, 26 Nov 2019 23:22:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574839320; cv=none; d=google.com; s=arc-20160816; b=NBVsmiV386IWKL8bZHoKfLDdR3nd7LFl9Ub4vsfStBxtAINbSeDliLXN9MyTysLfsD 7NBEg+u36Ga3M+qwIkz2yc++vJjBsXx/WWGmj7Apycv4UnmzxcrriAhT+QCF5TzG00Si 0n6PpXzz1VoAkVCklsabGwK7GY+H4wb+vVkYKGi4DkoK/r4J66l5LUgBT4OGd7xR/Dje e7GQq7i0/KbXBHJfQzs5Ds2PbsEQ6ULfRUZqCcNtVWQ/o0dWBMViSottf2B2Cnt8uFWZ B/xH+PtvltnGz4duRzoeuDP2q6P5wF8CuQBY0XTkRmuN/4ugDYt/luaVNgRCq1gwQo4I 9/vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=eZYw16U+8nuxkccXCYNgtvJx1TG7O/vbSuX+/oKS/b8=; b=m/Yh3KGnM8ooSEk2ucVMEtMDEpnXmmz7s7Zg9akm6P8siEXoSxTfHu3HjkMNh0k/02 B+LJ60xhh7sWE5dHxk3O9SaPciBK2zk+LivRosdo1/KLaN1goXK57ZcJyvvDfBzXSkvz GSnsfc90ncnmRIReHDjDqrCl7t9SZArUDIFyEfollxRqjN8wVqvpPqAam2qE+sPpnAXP 83wy68t8xdYPQbqTJAe7pMVElJcfPgfrJMeOwzvFWPckm1ucDO4uLCPtRPdAj7UZB5ZD pglfsPCgF6/XreN+eZEx9RQk4OTYjwD/jjh5zbkxhbhGS8Ve4PW/kW1c8ea8lH5satYA TkIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JVUkem6m; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si69058ejc.66.2019.11.26.23.22.00; Tue, 26 Nov 2019 23:22:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JVUkem6m; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbfK0HV6 (ORCPT + 15 others); Wed, 27 Nov 2019 02:21:58 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42699 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726260AbfK0HV6 (ORCPT ); Wed, 27 Nov 2019 02:21:58 -0500 Received: by mail-wr1-f67.google.com with SMTP id a15so25372046wrf.9 for ; Tue, 26 Nov 2019 23:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=eZYw16U+8nuxkccXCYNgtvJx1TG7O/vbSuX+/oKS/b8=; b=JVUkem6mwUz7LUmutuOGbPEynAM3riP2XuMK7Us1xCv3+TGT3hmebH4LX9Jgyk6yyA c//7f7HoQzfSVOlPqi1lU885qL2BWLAAkjs4crY1nocRD4sCumDJt+uO1ZyHS9gTArpy zWBeJojZEg8s9yUs/PphkMplgphJUjX5Blp79Z26/X2q0cJOS5qKvosw+7CfsOj0dMYk VxyHQlsPdLU2hIB4/KGzztRLpulOZyRUAIbO/eUTjuI+iWsMHF1DUqhnGGjzI0s51rS4 oPeHm/SE3Z5tI2anEPUizL0ysd/k418IhoBYJq6SSfd8zSROMLb+ur7UxEO7/VoAU/EJ SkkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eZYw16U+8nuxkccXCYNgtvJx1TG7O/vbSuX+/oKS/b8=; b=Gnuia5mcaPShMer8P8jsbuLZCEPlR+SC8AlfFHPkLYmTCWPZi0UQARD1m9k3051d7o GbIsfFPUP+O8mjW6bMIwMckYcUmdznvpS9t9R5HXZKEOIoFr4Lmfzg+5EzXwLHTHdVM1 0ekRXHaWvT1IsMgxF29As2guB73uOEaFw2KWLCtPJdXMRnHFKkh7AwYIwqH2aG/8Svzx TmiffwluQl2GVQor5XRGf5UMXFlcvvJfof7Fv554EHIRL9cHT2qgM+O1vkBjkV3PHkYL Fm/Hq/LtwLEc2pN36dPST/exanEiWhQfwuYRvgJXSHVbqaW7gTvVOjpVM4z7zsxz5FwM ft1g== X-Gm-Message-State: APjAAAVIgXst+Ku9A0SKcZEjhV6K3VbxrcEYGs1M5pHKXGiwLGbUWtN9 BzoWz9rrGxydLTGuLSXf4B6dNVVQY58= X-Received: by 2002:adf:e506:: with SMTP id j6mr42008736wrm.19.1574839313896; Tue, 26 Nov 2019 23:21:53 -0800 (PST) Received: from localhost.localdomain ([95.149.164.101]) by smtp.gmail.com with ESMTPSA id y6sm18151872wrn.21.2019.11.26.23.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:21:53 -0800 (PST) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.4 6/6] ocfs2: remove ocfs2_is_o2cb_active() Date: Wed, 27 Nov 2019 07:21:24 +0000 Message-Id: <20191127072124.30445-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127072124.30445-1-lee.jones@linaro.org> References: <20191127072124.30445-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gang He [ Upstream commit a634644751c46238df58bbfe992e30c1668388db ] Remove ocfs2_is_o2cb_active(). We have similar functions to identify which cluster stack is being used via osb->osb_cluster_stack. Secondly, the current implementation of ocfs2_is_o2cb_active() is not totally safe. Based on the design of stackglue, we need to get ocfs2_stack_lock before using ocfs2_stack related data structures, and that active_stack pointer can be NULL in the case of mount failure. Link: http://lkml.kernel.org/r/1495441079-11708-1-git-send-email-ghe@suse.com Signed-off-by: Gang He Reviewed-by: Joseph Qi Reviewed-by: Eric Ren Acked-by: Changwei Ge Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Lee Jones --- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/stackglue.c | 6 ------ fs/ocfs2/stackglue.h | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) -- 2.24.0 diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 555b57a16499..faaf8bfd2f52 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3426,7 +3426,7 @@ static int ocfs2_downconvert_lock(struct ocfs2_super *osb, * we can recover correctly from node failure. Otherwise, we may get * invalid LVB in LKB, but without DLM_SBF_VALNOTVALID being set. */ - if (!ocfs2_is_o2cb_active() && + if (ocfs2_userspace_stack(osb) && lockres->l_ops->flags & LOCK_TYPE_USES_LVB) lvb = 1; diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 783bcdce5666..5d965e83bd43 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -48,12 +48,6 @@ static char ocfs2_hb_ctl_path[OCFS2_MAX_HB_CTL_PATH] = "/sbin/ocfs2_hb_ctl"; */ static struct ocfs2_stack_plugin *active_stack; -inline int ocfs2_is_o2cb_active(void) -{ - return !strcmp(active_stack->sp_name, OCFS2_STACK_PLUGIN_O2CB); -} -EXPORT_SYMBOL_GPL(ocfs2_is_o2cb_active); - static struct ocfs2_stack_plugin *ocfs2_stack_lookup(const char *name) { struct ocfs2_stack_plugin *p; diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h index e1b30931974d..66334a30cea8 100644 --- a/fs/ocfs2/stackglue.h +++ b/fs/ocfs2/stackglue.h @@ -298,7 +298,4 @@ void ocfs2_stack_glue_set_max_proto_version(struct ocfs2_protocol_version *max_p int ocfs2_stack_glue_register(struct ocfs2_stack_plugin *plugin); void ocfs2_stack_glue_unregister(struct ocfs2_stack_plugin *plugin); -/* In ocfs2_downconvert_lock(), we need to know which stack we are using */ -int ocfs2_is_o2cb_active(void); - #endif /* STACKGLUE_H */