From patchwork Thu Feb 27 21:16:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CAAC1580 for ; Thu, 27 Feb 2020 21:50:51 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3485D24692 for ; Thu, 27 Feb 2020 21:50:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3485D24692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 3B5223491A5; Thu, 27 Feb 2020 13:43:43 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 6423021FCD8 for ; Thu, 27 Feb 2020 13:20:56 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 3B3559194; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 3A5A646A; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:16:15 -0500 Message-Id: <1582838290-17243-508-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 507/622] lustre: llite: clear flock when using localflock X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Andreas Dilger When mounting a client with "-o localflock" or equivalent option in /etc/fstab, it does not clear out the "flock" mount option flag from the superblock. This results in "flock" still being the option used and it displays both options in the /proc/mounts output: 10.0.0.1@o2ib:/lfs on /mnt/lfs type lustre (rw,flock,localflock) Mount a client with both "flock,localflock" as mount options and verify that the "flock" option is cleared by "localflock", and vice versa. Verify that "noflock" clears both options. Remove the "remount_client()" helper in conf-sanity.sh, since this shadows a helper function of the same name in test-framework.sh and is confusing. Instead, use "mount_client()" now that it can accept mount options, and just pass "remount" explicitly in a few places. Fixes: 083c51418b67 ("lustre: llite: enable flock mount option by default") WC-bug-id: https://jira.whamcloud.com/browse/LU-12859 Lustre-commit: 22ee4a1f64ec ("LU-12859 llite: clear flock when using localflock") Signed-off-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/36452 Reviewed-by: Ben Evans Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/llite_lib.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/lustre/llite/llite_lib.c b/fs/lustre/llite/llite_lib.c index 4580be3..49490ee 100644 --- a/fs/lustre/llite/llite_lib.c +++ b/fs/lustre/llite/llite_lib.c @@ -823,12 +823,12 @@ static int ll_options(char *options, struct ll_sb_info *sbi) } tmp = ll_set_opt("flock", s1, LL_SBI_FLOCK); if (tmp) { - *flags |= tmp; + *flags = (*flags & ~LL_SBI_LOCALFLOCK) | tmp; goto next; } tmp = ll_set_opt("localflock", s1, LL_SBI_LOCALFLOCK); if (tmp) { - *flags |= tmp; + *flags = (*flags & ~LL_SBI_FLOCK) | tmp; goto next; } tmp = ll_set_opt("noflock", s1, @@ -2672,11 +2672,16 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry) if (sbi->ll_flags & LL_SBI_NOLCK) seq_puts(seq, ",nolock"); + /* "flock" is the default since 2.13, but it wasn't for many years, + * so it is still useful to print this to show it is enabled. + * Start to print "noflock" so it is now clear when flock is disabled. + */ if (sbi->ll_flags & LL_SBI_FLOCK) seq_puts(seq, ",flock"); - - if (sbi->ll_flags & LL_SBI_LOCALFLOCK) + else if (sbi->ll_flags & LL_SBI_LOCALFLOCK) seq_puts(seq, ",localflock"); + else + seq_puts(seq, ",noflock"); if (sbi->ll_flags & LL_SBI_USER_XATTR) seq_puts(seq, ",user_xattr");