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