Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6014294ybc; Wed, 27 Nov 2019 13:24:56 -0800 (PST) X-Google-Smtp-Source: APXvYqySLpijhPPahDknT2QTCV3cShdWQd6pNdIUnxrE+CtCZvCdKjEAozu0deTZy7Vzme4Jk8Wb X-Received: by 2002:a17:906:5448:: with SMTP id d8mr49688238ejp.79.1574889896529; Wed, 27 Nov 2019 13:24:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889896; cv=none; d=google.com; s=arc-20160816; b=uF8Vv6WycD4jsLHwVw+fmdH8hoagG8cw5MAxoSmJ4qeaHZxuZ9vxp13Q3/UyM+CONw tH3Ja9blkouU2sNKWnhtX5n1ikbVS8gcJNl6zzaYWyLUgiufW+quLPAP2nYhuF674UjJ ibcjAYNjTnYYaGJJYReCbtN8zxfqMiGzDzweikwCrrd0urjuwqnscuFd0LiaJeeNnVG+ pFDUvsebzxMvE7PzoOrv2y0ktmg3/sn8qgFSz546UxH/mr9OtveJ96DCrvGiIfg+bO60 1nJCB/YzW2+IxAEEfouWxQBB6MhfAFh8q5q8XH4ZoiJzLcp33kqjOWJsbKnAMiOmPflX u9HA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eYGzkNICbR9Uh+HKX7PhuNLb0Bh/dVBc7uA8f9OkCl4=; b=sQBHVp4J0Y62evfGL0PSaP+z+PaZOTtgc3ZMVO/u6Gng6sFGQSz3Nis8wmTVfhygWu qLyrBJ+maCBTGkpZBd+f7t+AcxOyqc+BcR6CujjnDkpZ/7diP0C1FfPuzR7jTX2fhqOm 6tSxghw0gSRxNjLIY+cYAmbm4U8pH2MvwAP4SG0jb40XyYNvJoi0i5quX7W+Lr0uWZnZ BlQkqGCu7gtB5UODKScnoNfKUS4pNF/My9W/My3X2W0HEpZ/R7A/h2YHA1l4a3wlzYPe eEuYPd81zQuyxadOCsIcN3Cs0d6ZnTKurSZdm6T7NLzD0InfqBmD17WJXoUeRkmJCGAj ssVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CzufqzpQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dc21si10512140ejb.101.2019.11.27.13.24.32; Wed, 27 Nov 2019 13:24:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=CzufqzpQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732407AbfK0VGV (ORCPT + 99 others); Wed, 27 Nov 2019 16:06:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:60300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfK0VGS (ORCPT ); Wed, 27 Nov 2019 16:06:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC93021770; Wed, 27 Nov 2019 21:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888777; bh=dZvexBe28LkdVb8dTGUN63UBYjHJZ+tVRGX71Tjw5LE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzufqzpQ3UxIuvZAEgBB3OY0S+MytgJpsmFFoVfBx5f96FkZMU3LqB1L/ammYmHQx kTyoGo982D+J+9qtzj/wqds1XUDH/w37ZknoycBljPWqlcAeMSgWyC5dlpyEMq3whK xc4JcsDqWFvsJpV7z/lAu3Gw0lTUNANVmPNnJRpc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gang He , Joseph Qi , Eric Ren , Changwei Ge , Mark Fasheh , Joel Becker , Junxiao Bi , Andrew Morton , Linus Torvalds , Lee Jones Subject: [PATCH 4.19 264/306] ocfs2: remove ocfs2_is_o2cb_active() Date: Wed, 27 Nov 2019 21:31:54 +0100 Message-Id: <20191127203134.120845835@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gang He commit a634644751c46238df58bbfe992e30c1668388db upstream. 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 Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/dlmglue.c | 2 +- fs/ocfs2/stackglue.c | 6 ------ fs/ocfs2/stackglue.h | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3603,7 +3603,7 @@ static int ocfs2_downconvert_lock(struct * 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; --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -48,12 +48,6 @@ static char ocfs2_hb_ctl_path[OCFS2_MAX_ */ 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; --- a/fs/ocfs2/stackglue.h +++ b/fs/ocfs2/stackglue.h @@ -298,9 +298,6 @@ void ocfs2_stack_glue_set_max_proto_vers 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); - extern struct kset *ocfs2_kset; #endif /* STACKGLUE_H */