[lkml]   [2022]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 2/6] Don't assume UID 0 attach
The writeback_fid fallback code assumes a root uid fallback which
breaks many server configurations (which don't run as root). This
patch switches to generic lookup which will follow argument
guidence on access modes and default ids to use on failure.

There is a deeper underlying problem with writeback_fids in that
this fallback is too standard and not an exception due to the way
writeback mode works in the current implementation. Subsequent
patches will try to associate writeback fids from the original user
either by flushing on close or by holding onto fid until writeback

Signed-off-by: Eric Van Hensbergen <>
fs/9p/fid.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 805151114e96..1fbd12d581bb 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -304,7 +304,9 @@ struct p9_fid *v9fs_writeback_fid(struct dentry *dentry)
int err;
struct p9_fid *fid, *ofid;

- ofid = v9fs_fid_lookup_with_uid(dentry, GLOBAL_ROOT_UID, 0);
+ /* pull default uid from dfltuid */
+ ofid = v9fs_fid_lookup(dentry);
fid = clone_fid(ofid);
if (IS_ERR(fid))
goto error_out;
 \ /
  Last update: 2022-12-17 20:19    [W:0.122 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site