[PATCH NOMERGE 04/13] vfs: Allow bind,remount with MS_CASEFOLD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxx>
---
 fs/namespace.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 0053e29b73cc..127d3028c1e8 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2261,17 +2261,28 @@ static int do_loopback(struct path *path, const char *old_name,
 static int change_mount_flags(struct vfsmount *mnt, int ms_flags)
 {
 	int error = 0;
-	int readonly_request = 0;
+	int readonly_request = 0, casefold_request = 0;
 
 	if (ms_flags & MS_RDONLY)
 		readonly_request = 1;
-	if (readonly_request == __mnt_is_readonly(mnt))
-		return 0;
+	if (ms_flags & MS_CASEFOLD)
+		casefold_request = 1;
+
+	if (readonly_request != __mnt_is_readonly(mnt)) {
+		if (readonly_request)
+			error = mnt_make_readonly(real_mount(mnt));
+		else
+			__mnt_unmake_readonly(real_mount(mnt));
+		if (error)
+			goto out;
+	}
 
-	if (readonly_request)
-		error = mnt_make_readonly(real_mount(mnt));
+	if (casefold_request)
+		mnt->mnt_flags |= MNT_CASEFOLD;
 	else
-		__mnt_unmake_readonly(real_mount(mnt));
+		mnt->mnt_flags &= ~MNT_CASEFOLD;
+
+out:
 	return error;
 }
 
-- 
2.17.0




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux