[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <871rjqh5bw.fsf@platform.sh>
Date: Fri, 28 Aug 2020 22:40:35 +0200
From: Florian Margaine <florian@...tform.sh>
To: viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] fs: allow do_renameat2() over bind mounts of the same filesystem.
There's currently this seemingly unnecessary limitation that rename()
cannot work over bind mounts of the same filesystem, because the
current check is against the vfsmount, not over the superblock. Given
that the path in do_renameat2() is using dentries, the rename is
properly supported across different mount points, because it is
supported as it is the same superblock.
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namei.c b/fs/namei.c
index e99e2a9da0f7..863e5be88278 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4386,7 +4386,7 @@ static int do_renameat2(int olddfd, const char __user *oldname, int newdfd,
}
error = -EXDEV;
- if (old_path.mnt != new_path.mnt)
+ if (old_path.mnt->mnt_sb != new_path.mnt->mnt_sb)
goto exit2;
error = -EBUSY;
--
2.26.2
Download attachment "signature.asc" of type "application/pgp-signature" (488 bytes)
Powered by blists - more mailing lists