linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
To: viro@ZenIV.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org,
	Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Subject: [PATCH NOMERGE 04/13] vfs: Allow bind,remount with MS_CASEFOLD
Date: Tue, 22 May 2018 17:38:09 -0300	[thread overview]
Message-ID: <20180522203818.14666-5-krisman@collabora.co.uk> (raw)
In-Reply-To: <20180522203818.14666-1-krisman@collabora.co.uk>

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 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

  parent reply	other threads:[~2018-05-22 20:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 20:38 [PATCH NOMERGE 00/13] Case insensitiveness as a mountpoint Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 01/13] vfs: Add support for mounting with MS_CASEFOLD Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 02/13] vfs: Propagate LOOKUP_CASEFOLD after doing parent lookups Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 03/13] vfs: Add support for positive dentries CI lookups in the dentry cache Gabriel Krisman Bertazi
2018-05-22 20:38 ` Gabriel Krisman Bertazi [this message]
2018-05-22 20:38 ` [PATCH NOMERGE 05/13] vfs: Handle case-exact lookup in d_add_ci Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 06/13] vfs: Add Support for hard negative dentries in the dcache Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 07/13] vfs: Handle MNT_CASEFOLD in /proc/mounts Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 08/13] fscrypt: Introduce charset-based matching functions Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 09/13] ext4: Include encoding information on the superblock Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 10/13] ext4: Plumb LOOK_CASEFOLD up to ext4 comparison functions Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 11/13] ext4: Support charset name matching Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 12/13] ext4: Implement ext4 dcache hooks for custom charsets Gabriel Krisman Bertazi
2018-05-22 20:38 ` [PATCH NOMERGE 13/13] ext4: Notify VFS of support for casefolded mountpoints Gabriel Krisman Bertazi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180522203818.14666-5-krisman@collabora.co.uk \
    --to=krisman@collabora.co.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    --subject='Re: [PATCH NOMERGE 04/13] vfs: Allow bind,remount with MS_CASEFOLD' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).