summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-24 13:37:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-24 13:37:26 -0700
commitbdcb864c719f7cf8629ada18450fd4efbb16afe8 (patch)
tree718baa82d9a32732a9ab06cc398c79f31d5f1455 /fs
parentf9569c6ce4a4bbad0876ca7bd1e04fbfbbc1641f (diff)
parent8fc518e489c1386fd0cf7f4256d055960ed6a2e4 (diff)
Merge tag '9p-for-7.1-rc1' of https://github.com/martinetd/linux
Pull 9p updates from Dominique Martinet: - 9p access flag fix (cannot change access flag since new mount API implem) - some minor cleanup * tag '9p-for-7.1-rc1' of https://github.com/martinetd/linux: 9p/trans_xen: replace simple_strto* with kstrtouint 9p/trans_xen: make cleanup idempotent after dataring alloc errors 9p: document missing enum values in kernel-doc comments 9p: fix access mode flags being ORed instead of replaced 9p: fix memory leak in v9fs_init_fs_context error path
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/v9fs.c4
-rw-r--r--fs/9p/vfs_super.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 057487efaaeb..acda42499ca9 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -413,7 +413,11 @@ static void v9fs_apply_options(struct v9fs_session_info *v9ses,
/*
* Note that we must |= flags here as session_init already
* set basic flags. This adds in flags from parsed options.
+ * Default access flags must be cleared if session options
+ * changes them to avoid mangling the setting.
*/
+ if (ctx->session_opts.flags & V9FS_ACCESS_MASK)
+ v9ses->flags &= ~V9FS_ACCESS_MASK;
v9ses->flags |= ctx->session_opts.flags;
#ifdef CONFIG_9P_FSCACHE
v9ses->cachetag = ctx->session_opts.cachetag;
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 0a1c4f7cb001..431f24938a1d 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -312,6 +312,9 @@ static int v9fs_init_fs_context(struct fs_context *fc)
if (!ctx)
return -ENOMEM;
+ fc->ops = &v9fs_context_ops;
+ fc->fs_private = ctx;
+
/* initialize core options */
ctx->session_opts.afid = ~0;
ctx->session_opts.cache = CACHE_NONE;
@@ -345,9 +348,6 @@ static int v9fs_init_fs_context(struct fs_context *fc)
ctx->rdma_opts.timeout = P9_RDMA_TIMEOUT;
ctx->rdma_opts.privport = false;
- fc->ops = &v9fs_context_ops;
- fc->fs_private = ctx;
-
return 0;
error:
fc->need_free = 1;