From patchwork Fri Aug 23 07:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Lingfeng X-Patchwork-Id: 13774654 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 672A753E15; Fri, 23 Aug 2024 06:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395852; cv=none; b=JBfhu1HZOvrA5/oGhDiwgzlKA7M7vmD7qCqafByjKy1qqwPNTF5k6YLXyVCz2QqNEJuaJSil0lJPDTmXGfo5OSKwjeydQ1hWqmW0kGa2320k6Pm7DQOCB/hIpkG7pwKE5G7jR6JaSWTbqoVxbInXvP9JBNtWbFKqRmPk9cf+GBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395852; c=relaxed/simple; bh=ln7nj3CVBqs/Nyw39xnFIK0Qn6bGh4O29aiJlDvojQc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Vj4R25aMqUl0J6YOGdqCyNeqosDpDYSgpHKod0nLJ3VnbsGZCM6y7kkPbwE9COlcqiZC+RGq8zvFx3pEw3QeIE/4MK1mTHFcd315QkdR3lS9Ui5l5nnC6plqTV0FAgqOa9YGgIwbgX+OZefXdALuVrLA/I89juIyKiyuUIc+7LA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.44]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WqrLV4KsDz1S8XF; Fri, 23 Aug 2024 14:50:42 +0800 (CST) Received: from kwepemg500017.china.huawei.com (unknown [7.202.181.81]) by mail.maildlp.com (Postfix) with ESMTPS id D25E01402C7; Fri, 23 Aug 2024 14:50:47 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemg500017.china.huawei.com (7.202.181.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 23 Aug 2024 14:50:46 +0800 From: Li Lingfeng To: , , , , , , , CC: , , , , , , , Subject: [PATCH 1/4] nfsd: fix the comment of nfs_get_root Date: Fri, 23 Aug 2024 15:00:46 +0800 Message-ID: <20240823070049.3499625-2-lilingfeng3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240823070049.3499625-1-lilingfeng3@huawei.com> References: <20240823070049.3499625-1-lilingfeng3@huawei.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemg500017.china.huawei.com (7.202.181.81) The comment for nfs_get_root() needs to be updated as it would also be used by NFS4 as follows: @x[ nfs_get_root+1 nfs_get_tree_common+1819 nfs_get_tree+2594 vfs_get_tree+73 fc_mount+23 do_nfs4_mount+498 nfs4_try_get_tree+134 nfs_get_tree+2562 vfs_get_tree+73 path_mount+2776 do_mount+226 __se_sys_mount+343 __x64_sys_mount+106 do_syscall_64+69 entry_SYSCALL_64_after_hwframe+97 , mount.nfs4]: 1 Signed-off-by: Li Lingfeng Acked-by: Jeff Layton --- fs/nfs/getroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index 11ff2b2e060f..f13d25d95b85 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -62,7 +62,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i } /* - * get an NFS2/NFS3 root dentry from the root filehandle + * get a root dentry from the root filehandle */ int nfs_get_root(struct super_block *s, struct fs_context *fc) { From patchwork Fri Aug 23 07:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Lingfeng X-Patchwork-Id: 13774656 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93F4313A409; Fri, 23 Aug 2024 06:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395855; cv=none; b=depy78MYWQTVJoQRcU+CHwv2LG9H+Th1iijGrdHdYN/SX191ikHH9WhLGez68ToicwPOl4m968nTjPbEvoshYEdLxenigfzSvdaQkT7AYBU6QU77p+M1kXxTWk2F4wVoGgqxD39LBMfE2wjwlTXBjful/qU3Ofgzq1UhT811nSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395855; c=relaxed/simple; bh=SZ5yX0eRiHE+dktGG5I5u6Ld2P09IJD02hKGmK1MVLw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VlZihmhWrbEVnN2Ax3U6huFPv5GvS4GtSwpeTx9vD5fqeFFlCFOIHCZerqYtwYLxZyXIc3+SO1Abe7kasOR8PCkQuiPPqPCVV4jimUVYl5ZnkEJFRuoYsYXuSekrNUkF4zUVmcxEftZqqDmClnFdMcmZMzK2HbPBykREbpfakek= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WqrL82LnyzyR58; Fri, 23 Aug 2024 14:50:24 +0800 (CST) Received: from kwepemg500017.china.huawei.com (unknown [7.202.181.81]) by mail.maildlp.com (Postfix) with ESMTPS id F056E140137; Fri, 23 Aug 2024 14:50:48 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemg500017.china.huawei.com (7.202.181.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 23 Aug 2024 14:50:47 +0800 From: Li Lingfeng To: , , , , , , , CC: , , , , , , , Subject: [PATCH 2/4] nfsd: fix some spelling errors in comments Date: Fri, 23 Aug 2024 15:00:47 +0800 Message-ID: <20240823070049.3499625-3-lilingfeng3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240823070049.3499625-1-lilingfeng3@huawei.com> References: <20240823070049.3499625-1-lilingfeng3@huawei.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemg500017.china.huawei.com (7.202.181.81) Fix spelling errors in comments of nfsd4_release_lockowner and nfs4_set_delegation. Signed-off-by: Li Lingfeng --- fs/nfsd/nfs4state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a20c2c9d7d45..66a0c76850f3 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5856,7 +5856,7 @@ nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp, /* * Now that the deleg is set, check again to ensure that nothing - * raced in and changed the mode while we weren't lookng. + * raced in and changed the mode while we weren't looking. */ status = nfsd4_verify_setuid_write(open, fp->fi_deleg_file); if (status) @@ -8335,7 +8335,7 @@ check_for_locks(struct nfs4_file *fp, struct nfs4_lockowner *lowner) * @cstate: NFSv4 COMPOUND state * @u: RELEASE_LOCKOWNER arguments * - * Check if theree are any locks still held and if not - free the lockowner + * Check if there are any locks still held and if not - free the lockowner * and any lock state that is owned. * * Return values: From patchwork Fri Aug 23 07:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Lingfeng X-Patchwork-Id: 13774655 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9426713A40C; Fri, 23 Aug 2024 06:50:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395854; cv=none; b=dZnE1s7kEvDAsKlo/yCvAifqcb7CyJM+cSaoYC1N5xtG6s0GeN4HVQEplQWenG6M9p6JNeZKgb9zolWx7OMFcgNQJwPOcIvLubc3Rpu6lXD1izPAsXi0JhDEejCfZ5ic3cSHE9Rwrkz1z2cygR7d+iME1wiDbiOjBBOJf6+/PqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395854; c=relaxed/simple; bh=D5U6d4XLeFjw4drDmx1nzg2Fdt0+FMRUrHdqGVDbiMg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rQkHHvPX5yJ6qD1Dv8ccccbz3Kg/QxaOobyLf2gKzBEWSWVmpdR6ZV0qC0m5+1zh+9VuQm5S1dxRiOEB9d2McTxndOEA5FFaBcHyyk1SI4h7ptpBFhxBUs4o/0oyaL5vGdLpDuE2tOuepZsKTaInAO6QeBnhD8lo/iAvKVVN0tQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WqrLX6Btbz1S8Xh; Fri, 23 Aug 2024 14:50:44 +0800 (CST) Received: from kwepemg500017.china.huawei.com (unknown [7.202.181.81]) by mail.maildlp.com (Postfix) with ESMTPS id 1DA0214013B; Fri, 23 Aug 2024 14:50:50 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemg500017.china.huawei.com (7.202.181.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 23 Aug 2024 14:50:48 +0800 From: Li Lingfeng To: , , , , , , , CC: , , , , , , , Subject: [PATCH 3/4] nfsd: remove the redundant blank line Date: Fri, 23 Aug 2024 15:00:48 +0800 Message-ID: <20240823070049.3499625-4-lilingfeng3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240823070049.3499625-1-lilingfeng3@huawei.com> References: <20240823070049.3499625-1-lilingfeng3@huawei.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemg500017.china.huawei.com (7.202.181.81) Just remove the redundant blank line in do_open_permission. No function change. Signed-off-by: Li Lingfeng --- fs/nfsd/nfs4proc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 2e39cf2e502a..0068db924060 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -141,7 +141,6 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src) static __be32 do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode) { - if (open->op_truncate && !(open->op_share_access & NFS4_SHARE_ACCESS_WRITE)) return nfserr_inval; From patchwork Fri Aug 23 07:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Lingfeng X-Patchwork-Id: 13774657 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C616D13BC0C; Fri, 23 Aug 2024 06:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395855; cv=none; b=fOJfa9mUENQ7OfoLTqkbDl5nt82PCjy5sydZJpoyJ78eaz/kn3BOQ6s+zImzPg/VkeBfKdpxsSHgmreOv4zCPvCG3ZVe2Au4Gwq5ibJhEPnknZvZItvYZUuLWeuxELAa19M932mXMMicKZFIXx7U421un4IuR3dfTk7rH+UcSTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724395855; c=relaxed/simple; bh=P8ofQWwvbmIBj7URDzUe93HadsqjXVJpPxv/wn3f9Xw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cPO6LJwRPRxtlyvvCSPPUwNCAUyZEoKrhmkh4HbUbUTB+EjDBmM4T1uAppBMgO5mHpt08WJc6NDXo6a6DKutmhZeda7WQrfIZxQeT/Nmz5tNWJGOItGSPCTMtysSLentUOayWJvFzlIjU0t0AfdzF32n2sEEi3eEwEdITb7Cse0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4WqrJR6SgRz1xvpr; Fri, 23 Aug 2024 14:48:55 +0800 (CST) Received: from kwepemg500017.china.huawei.com (unknown [7.202.181.81]) by mail.maildlp.com (Postfix) with ESMTPS id 3CB9318001B; Fri, 23 Aug 2024 14:50:51 +0800 (CST) Received: from huawei.com (10.175.127.227) by kwepemg500017.china.huawei.com (7.202.181.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 23 Aug 2024 14:50:49 +0800 From: Li Lingfeng To: , , , , , , , CC: , , , , , , , Subject: [PATCH 4/4] nfsd: remove unused parameter of nfsd_file_mark_find_or_create Date: Fri, 23 Aug 2024 15:00:49 +0800 Message-ID: <20240823070049.3499625-5-lilingfeng3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240823070049.3499625-1-lilingfeng3@huawei.com> References: <20240823070049.3499625-1-lilingfeng3@huawei.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemg500017.china.huawei.com (7.202.181.81) Commit 427f5f83a319 ("NFSD: Ensure nf_inode is never dereferenced") passes inode directly to nfsd_file_mark_find_or_create instead of getting it from nf, so there is no need to pass nf. Signed-off-by: Li Lingfeng Reviewed-by: Jeff Layton --- fs/nfsd/filecache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index f4704f5d4086..376ec62e7794 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -151,7 +151,7 @@ nfsd_file_mark_put(struct nfsd_file_mark *nfm) } static struct nfsd_file_mark * -nfsd_file_mark_find_or_create(struct nfsd_file *nf, struct inode *inode) +nfsd_file_mark_find_or_create(struct inode *inode) { int err; struct fsnotify_mark *mark; @@ -1074,7 +1074,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, open_file: trace_nfsd_file_alloc(nf); - nf->nf_mark = nfsd_file_mark_find_or_create(nf, inode); + nf->nf_mark = nfsd_file_mark_find_or_create(inode); if (nf->nf_mark) { if (file) { get_file(file);