From patchwork Sun Nov 27 12:54:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 26353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5107316wrr; Sun, 27 Nov 2022 05:11:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ftk8y+cWjhE0W5Bwywq8KGG5u2CMv5lzSVnUOKFz+VKxE8MSz2UdUV1WjSwvSCqhmBr4+ X-Received: by 2002:a17:90a:7a82:b0:211:55d8:4cdd with SMTP id q2-20020a17090a7a8200b0021155d84cddmr48789558pjf.133.1669554676725; Sun, 27 Nov 2022 05:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669554676; cv=none; d=google.com; s=arc-20160816; b=rYmnaxnLy0IK/G7du5c315wPjAKL/6GuNRRMOX5ouUjLwqHIqVfcaifSxPR8GudMmi nBgIj7GN1Ph9hrlqU+hrnk3PQXcu/Nb/h+9XRisvTGDFi16FDvQ2XoAodSccBbQb4DK+ T8wFZej4gQW3fgz8m8LA35WVMK/34PlrCfqTdBEUpwjJYqX0qulbWN8IKceH4BhHJdhc h9SWVSjJAR8vjwnjgsRUG73xGRsbvA0/f7/tHatYJELFvpwn+ctW2ScYQ+fpusn9AfwE cKiUqf3AFSnfx1t9GyZ+5j9PB69enkX9if85IE4Xc7Fy0cplohUxO///NP+EeA8EsukH l8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+/gwq53s+yOrtaDnXOgMDY3qInFEyjZ4Z34ZEF9k31o=; b=inmj9idXepTrRDl94t4JnxnyA2wC8UJHzxTLYtKudL9tjGgJjKKwM4hAVRNQ7VGub/ uXqyTY7Hsc0vEqebmBzjryeCmuWEvtpMpvgMdzkk5uWTkJFTJLTum4JvLtaT4jAwMy2q 0P6FvJioqkgJBMUahlWOSr8FenHwxNvAzyc6VuoiQiqVHsogOy7cc+1KnwBKwoVTHatd LO5Vl0icve9qMZ8W8lCat1T5jTPr2rA00lLDY3u/y0ECKU606nU92M1rmfY3aijv9doe nGG4DcT4UOSBYoDiOr8Ho79+EsH64tP0IlJ289mrcHRnOLKSv/onaEmxMHIEyELqstfW EtHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DY0Zspi6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a134-20020a621a8c000000b0056cb8f6f027si8084027pfa.357.2022.11.27.05.11.03; Sun, 27 Nov 2022 05:11:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=DY0Zspi6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbiK0Myd (ORCPT + 99 others); Sun, 27 Nov 2022 07:54:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiK0Myc (ORCPT ); Sun, 27 Nov 2022 07:54:32 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA5E8B853; Sun, 27 Nov 2022 04:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=+/gwq53s+yOrtaDnXOgMDY3qInFEyjZ4Z34ZEF9k31o=; b=DY0Zspi6toRhkvomljYMhIBx4o 7NBElV2PwaHEU6Z+dPc+7EllibgMbWzMwxJP/D1aBBIkRNBzuqXUYGsV8iAkXkjmD2bk/6yyjUD7k 0p5EehuHGPrIdLWj6x5egLDK2ArUze9HStyyp9moDMGsWnqoVP8aQaMF6y0Q4iAuWLdsOFs/LfA3U NZOshhAlbziAqPvoshg3QZmql5AGiR6nOOl82k0cLj6s3dcR6iUaJb3tieyYF73GB/5rnLvRjiby2 L8NweRoZGLPKsJZFVO5NqN2f8vNV0zOZAGFGSiotCVBrseXuprx78xJoIormWUPrJuPl8GySJ5sPl /qDvceYA==; Received: from [2601:1c2:d80:3110::a2e7] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozHB6-00BbHf-LU; Sun, 27 Nov 2022 12:54:37 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , qiwuchen55@gmail.com, Al Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2 v2] fs/namespace.c: fix typos in comment Date: Sun, 27 Nov 2022 04:54:24 -0800 Message-Id: <20221127125424.10101-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750654964710485631?= X-GMAIL-MSGID: =?utf-8?q?1750654964710485631?= From: chenqiwu Fix the typos of correct parameter description. [v2: Randy] Change one function comment's "dest_dentry" to "dest_mp". Signed-off-by: chenqiwu Signed-off-by: Randy Dunlap Cc: qiwuchen55@gmail.com Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org --- fs/namespace.c | 7 ++++--- fs/pnode.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff -- a/fs/namespace.c b/fs/namespace.c --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2238,9 +2238,10 @@ int count_mounts(struct mnt_namespace *n } /* - * @source_mnt : mount tree to be attached - * @nd : place the mount tree @source_mnt is attached - * @parent_nd : if non-null, detach the source_mnt from its parent and + * @source_mnt : source mount. + * @dest_mnt : destination mount. + * @dest_mp : destination mountpoint. + * @moving : if true, attach source_mnt to dest_mnt and * store the parent mount and mountpoint dentry. * (done when source_mnt is moved) * diff -- a/fs/pnode.c b/fs/pnode.c --- a/fs/pnode.c +++ b/fs/pnode.c @@ -274,14 +274,14 @@ static int propagate_one(struct mount *m /* * mount 'source_mnt' under the destination 'dest_mnt' at - * dentry 'dest_dentry'. And propagate that mount to + * dentry 'dest_mp'. And propagate that mount to * all the peer and slave mounts of 'dest_mnt'. * Link all the new mounts into a propagation tree headed at * source_mnt. Also link all the new mounts using ->mnt_list * headed at source_mnt's ->mnt_list * * @dest_mnt: destination mount. - * @dest_dentry: destination dentry. + * @dest_mp: destination mountpoint. * @source_mnt: source mount. * @tree_list : list of heads of trees to be attached. */ From patchwork Sun Nov 27 12:54:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 26352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5106740wrr; Sun, 27 Nov 2022 05:10:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FQhPWwa5ejCLCSoRzxRyB/J7ZEa7D1L6Iv+70DtYubkZ0nW4/+aRJKtfyjnVcdIbHGH0P X-Received: by 2002:aa7:cc93:0:b0:462:6b8e:1ddb with SMTP id p19-20020aa7cc93000000b004626b8e1ddbmr42638166edt.276.1669554619057; Sun, 27 Nov 2022 05:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669554619; cv=none; d=google.com; s=arc-20160816; b=ReW2WlV7VeSLDd2Wnph7HIw8hA7HCkXh5+vNqbjTiFz5BbrVgdE6Fzl3v72RFthkDW zUL2v1Rbh2C5MT4ITQ0VkEvsMQ3eZ5D4rEpF1t8g7fMK93C0ac9leHshO0+RyORqlLP0 e7X91eNbr8dPejo+SaXeueUD8IYzsODzN2KEtnqEYvQpHFtlL1rUKfxvv6cNOQBlSwJW Vnwk0VwIm3laX6iGXEmEbY9uxGDmpDBV+hazETNEEXaWeuGuQoIh9F8pMFTib63sffl0 dhG+UhHPPLO7mJDzpiddB5mG/RhWmewytZwEZr4cJc23BVHoP5mx9R+dZS28KfPNbcV1 vJDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oVNk4lEQ0K1JdpA13/d2hKcImYfgFLWJtsaOrxQ63Ck=; b=UwAbtNMsWbh0z+Lvi/8v1dji4VuCAcpBbTVMJBPNLcozNvmtoCcTZzt1nDCX8KhzbV 13876yADzH8DM3feuW3gYv0sZ4zPCXU1DwrVg6cpUSpRxEEGof3xBiuK24zX2Rsa5WXK I2iPyLNPUSMdtc6AjuIe0UqFlicxjXq7/pjhJ1SiV/OZptneh6CXeywUVNBzEbvFrLmn cvnL+VMAAXnQQuHjKN0mLxqo0GWyWHyVhZdJelKRtXR16qPlVQkc5bxilEUTFKTtbIxP MAiwzZy+VAZxQrbTKy45YMNJH+mzHHuGP0oh8AtoKUYAa9UV7ji91vfgrdguSkoiN7FU VY+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZWifdx+p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a170906231400b007806c7c3fc1si6258410eja.975.2022.11.27.05.09.55; Sun, 27 Nov 2022 05:10:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZWifdx+p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbiK0Myz (ORCPT + 99 others); Sun, 27 Nov 2022 07:54:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbiK0Myy (ORCPT ); Sun, 27 Nov 2022 07:54:54 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08E4FAEE; Sun, 27 Nov 2022 04:54:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=oVNk4lEQ0K1JdpA13/d2hKcImYfgFLWJtsaOrxQ63Ck=; b=ZWifdx+pVnmKdy2vEN3gb2OEwH cBX2J5EnNkGmznKrcqozvJ9iZLqNPZshHU3QAQzO/f9UuwurMmLHZZ2bRgGSDKP8ebONFG9QzFyzH xtPoeHwLU+KY1dxBy/ZqeE0q6jG7n8lqwwWRQv5tULO5ELXraT11OohxcZ+gQ32e4aBLxr+9OY2QT QIrWA6hycT7isemTisGHYkmuj25PjlRHsYsc90hQ4Eu7m7MMQV37KYUt89NRNV3zDgefJU+Phn4Zz 0pDPcacWoT2hu0dGJFbRDVepBFKtgRXmZ95xdKeNRsgnQavam5iG9j+v4+yOXNde7/R06iNNCQFgq R5LzaiUA==; Received: from [2601:1c2:d80:3110::a2e7] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozHBS-00BbIo-46; Sun, 27 Nov 2022 12:54:58 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Al Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH 2/2 v2] fs/namespace.c: coding-style update Date: Sun, 27 Nov 2022 04:54:41 -0800 Message-Id: <20221127125441.10686-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750654904462771227?= X-GMAIL-MSGID: =?utf-8?q?1750654904462771227?= Fix coding style to use documented multi-line comment style and EXPORT_SYMBOL()s to immediately follow their function's closing brace line. Also fix a little punctuation and a few typos. Signed-off-by: Randy Dunlap Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org --- fs/namespace.c | 51 +++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff -- a/fs/namespace.c b/fs/namespace.c --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1189,8 +1189,9 @@ struct vfsmount * vfs_submount(const struct dentry *mountpoint, struct file_system_type *type, const char *name, void *data) { - /* Until it is worked out how to pass the user namespace - * through from the parent mount to the submount don't support + /* + * Until it is worked out how to pass the user namespace + * through from the parent mount to the submount, don't support * unprivileged mounts with submounts. */ if (mountpoint->d_sb->s_user_ns != &init_user_ns) @@ -1253,8 +1254,10 @@ static struct mount *clone_mnt(struct mo if (flag & CL_MAKE_SHARED) set_mnt_shared(mnt); - /* stick the duplicate mount on the same expiry list - * as the original if that was on one */ + /* + * stick the duplicate mount on the same expiry list + * as the original if that was on one + */ if (flag & CL_EXPIRE) { if (!list_empty(&old->mnt_expire)) list_add(&mnt->mnt_expire, &old->mnt_expire); @@ -1552,7 +1555,6 @@ int may_umount_tree(struct vfsmount *m) return 1; } - EXPORT_SYMBOL(may_umount_tree); /** @@ -1579,7 +1581,6 @@ int may_umount(struct vfsmount *mnt) up_read(&namespace_sem); return ret; } - EXPORT_SYMBOL(may_umount); static void namespace_unlock(void) @@ -1628,7 +1629,8 @@ static bool disconnect_mount(struct moun if (!mnt_has_parent(mnt)) return true; - /* Because the reference counting rules change when mounts are + /* + * Because the reference counting rules change when mounts are * unmounted and connected, umounted mounts may not be * connected to mounted mounts. */ @@ -1966,7 +1968,8 @@ struct ns_common *from_mnt_ns(struct mnt static bool mnt_ns_loop(struct dentry *dentry) { - /* Could bind mounting the mount namespace inode cause a + /* + * Could bind mounting the mount namespace inode cause a * mount namespace loop? */ struct mnt_namespace *mnt_ns; @@ -2314,7 +2317,8 @@ static int attach_recursive_mnt(struct m struct hlist_node *n; int err; - /* Preallocate a mountpoint in case the new mounts need + /* + * Preallocate a mountpoint in case the new mounts need * to be tucked under other mounts. */ smp = get_mountpoint(source_mnt->mnt.mnt_root); @@ -2991,8 +2995,10 @@ static int do_move_mount(struct path *ol if (err) goto out; - /* if the mount is moved, it should no longer be expire - * automatically */ + /* + * if the mount is moved, it should no longer be expired + * automatically + */ list_del_init(&old->mnt_expire); if (attached) put_mountpoint(old_mp); @@ -3164,8 +3170,9 @@ int finish_automount(struct vfsmount *m, return PTR_ERR(m); mnt = real_mount(m); - /* The new mount record should have at least 2 refs to prevent it being - * expired before we get a chance to add it + /* + * The new mount record should have at least 2 refs to prevent it being + * expired before we get a chance to add it. */ BUG_ON(mnt_get_count(mnt) < 2); @@ -3252,7 +3259,8 @@ void mark_mounts_for_expiry(struct list_ namespace_lock(); lock_mount_hash(); - /* extract from the expiration list every vfsmount that matches the + /* + * extract from the expiration list every vfsmount that matches the * following criteria: * - only referenced by its parent vfsmount * - still marked for expiry (marked on the last call here; marks are @@ -3815,7 +3823,8 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, uns newmount.dentry = dget(fc->root); newmount.mnt->mnt_flags = mnt_flags; - /* We've done the mount bit - now move the file context into more or + /* + * We've done the mount bit - now move the file context into more or * less the same state as if we'd done an fspick(). We don't want to * do any memory allocation or anything like that at this point as we * don't want to have to handle any errors incurred. @@ -3834,7 +3843,8 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, uns list_add(&mnt->mnt_list, &ns->list); mntget(newmount.mnt); - /* Attach to an apparent O_PATH fd with a note that we need to unmount + /* + * Attach to an apparent O_PATH fd with a note that we need to unmount * it, not just simply put it. */ file = dentry_open(&newmount, O_PATH, fc->cred); @@ -3883,7 +3893,8 @@ SYSCALL_DEFINE5(move_mount, if (flags & ~MOVE_MOUNT__MASK) return -EINVAL; - /* If someone gives a pathname, they aren't permitted to move + /* + * If someone gives a pathname, they aren't permitted to move * from an fd that requires unmount as we can't get at the flag * to clear it afterwards. */ @@ -4643,7 +4654,8 @@ static bool mnt_already_visible(struct m if (mnt->mnt.mnt_sb->s_type != sb->s_type) continue; - /* This mount is not fully visible if it's root directory + /* + * This mount is not fully visible if it's root directory * is not the root directory of the filesystem. */ if (mnt->mnt.mnt_root != mnt->mnt.mnt_sb->s_root) @@ -4666,7 +4678,8 @@ static bool mnt_already_visible(struct m ((mnt_flags & MNT_ATIME_MASK) != (new_flags & MNT_ATIME_MASK))) continue; - /* This mount is not fully visible if there are any + /* + * This mount is not fully visible if there are any * locked child mounts that cover anything except for * empty directories. */