All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH dhowells/mount-api 1/2] fs/fsconfig: handle FSCONFIG_CMD_RECONFIGURE
@ 2018-08-10 22:00 Andrei Vagin
  2018-08-10 22:00 ` [PATCH dhowells/mount-api 2/2] selftests: implement a test for a new mount API Andrei Vagin
  2018-08-10 22:52 ` [PATCH dhowells/mount-api 1/2] fs/fsconfig: handle FSCONFIG_CMD_RECONFIGURE David Howells
  0 siblings, 2 replies; 7+ messages in thread
From: Andrei Vagin @ 2018-08-10 22:00 UTC (permalink / raw)
  To: David Howells; +Cc: linux-fsdevel, Andrei Vagin

From: Andrei Vagin <avagin@gmail.com>

It looks like everything is already prepared for that and we only need
to call do_remount_sb() to apply changes from fs_context.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
---
 fs/fsopen.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/fs/fsopen.c b/fs/fsopen.c
index e79bb5b085d6..6991230a7b59 100644
--- a/fs/fsopen.c
+++ b/fs/fsopen.c
@@ -273,7 +273,25 @@ static int vfs_fsconfig_action(struct fs_context *fc, enum fsconfig_command cmd)
 		else
 			fc->phase = FS_CONTEXT_FAILED;
 		return ret;
+	case FSCONFIG_CMD_RECONFIGURE:
+	{
+		struct super_block *sb;
+
+		if (fc->phase != FS_CONTEXT_RECONF_PARAMS)
+			return -EBUSY;
 
+		fc->phase = FS_CONTEXT_RECONFIGURING;
+		sb = fc->root->d_sb;
+		down_write(&sb->s_umount);
+		ret = do_remount_sb(sb, 0, NULL, 0, 0, fc);
+		up_write(&sb->s_umount);
+
+		if (ret == 0)
+			fc->phase = FS_CONTEXT_CREATE_PARAMS;
+		else
+			fc->phase = FS_CONTEXT_FAILED;
+		return ret;
+	}
 	default:
 		return -EOPNOTSUPP;
 	}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-21 12:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-10 22:00 [PATCH dhowells/mount-api 1/2] fs/fsconfig: handle FSCONFIG_CMD_RECONFIGURE Andrei Vagin
2018-08-10 22:00 ` [PATCH dhowells/mount-api 2/2] selftests: implement a test for a new mount API Andrei Vagin
2018-08-10 22:55   ` David Howells
2018-08-20 23:29     ` Andrei Vagin
2018-08-21  9:19       ` David Howells
2018-08-20 23:47   ` Dave Chinner
2018-08-10 22:52 ` [PATCH dhowells/mount-api 1/2] fs/fsconfig: handle FSCONFIG_CMD_RECONFIGURE David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.