<20230330-vfs-mount_setattr-propagation-fix-v1-1-37548d915...@kernel.org>
Subject: [PATCH RHEL7 COMMIT] ms/fs: drop peer group ids under namespace lock

The commit is pushed to "branch-rh7-3.10.0-1160.88.1.vz7.195.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.88.1.vz7.195.2
------>
commit bf3c9c51c83aa9f6c37b29deca993510d8d9903f
Author: Christian Brauner <[email protected]>
Date:   Thu Apr 13 18:47:24 2023 +0800

    ms/fs: drop peer group ids under namespace lock
    
    When cleaning up peer group ids in the failure path we need to make sure
    to hold on to the namespace lock. Otherwise another thread might just
    turn the mount from a shared into a non-shared mount concurrently.
    
    Link: https://lore.kernel.org/lkml/[email protected]
    Fixes: 2a1867219c7b ("fs: add mount_setattr()")
    Reported-by: [email protected]
    Cc: [email protected] # 5.12+
    Message-Id: 
<20230330-vfs-mount_setattr-propagation-fix-v1-1-37548d915...@kernel.org>
    Signed-off-by: Christian Brauner <[email protected]>
    
    (cherry picked from commit cb2239c198ad9fbd5aced22cf93e45562da781eb)
    https://jira.sw.ru/browse/PSBM-144416
    Signed-off-by: Pavel Tikhomirov <[email protected]>
    
    =================
    Patchset description:
    mount: Port move_mount_set_group and mount_setattr
    
    We need this as in Virtuozzo criu after rebase to mainstream criu in u20
    we will switch to this new API for sharing group setting accross mounts.
    
    https://jira.vzint.dev/browse/PSBM-144416
---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index f37cae055dbf..49d972024249 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4280,9 +4280,9 @@ static int do_mount_setattr(struct path *path, struct 
mount_kattr *kattr)
        unlock_mount_hash();
 
        if (kattr->propagation) {
-               namespace_unlock();
                if (err)
                        cleanup_group_ids(mnt, NULL);
+               namespace_unlock();
        }
 
        return err;
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to