diff options
Diffstat (limited to 'fs/9p/fid.c')
-rw-r--r-- | fs/9p/fid.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c index da8eefbe830d..afd4724b2d92 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c | |||
@@ -74,19 +74,20 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid) | |||
74 | * | 74 | * |
75 | */ | 75 | */ |
76 | 76 | ||
77 | static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any) | 77 | static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) |
78 | { | 78 | { |
79 | struct v9fs_dentry *dent; | 79 | struct v9fs_dentry *dent; |
80 | struct p9_fid *fid, *ret; | 80 | struct p9_fid *fid, *ret; |
81 | 81 | ||
82 | p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n", | 82 | p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n", |
83 | dentry->d_name.name, dentry, uid, any); | 83 | dentry->d_name.name, dentry, from_kuid(&init_user_ns, uid), |
84 | any); | ||
84 | dent = (struct v9fs_dentry *) dentry->d_fsdata; | 85 | dent = (struct v9fs_dentry *) dentry->d_fsdata; |
85 | ret = NULL; | 86 | ret = NULL; |
86 | if (dent) { | 87 | if (dent) { |
87 | spin_lock(&dent->lock); | 88 | spin_lock(&dent->lock); |
88 | list_for_each_entry(fid, &dent->fidlist, dlist) { | 89 | list_for_each_entry(fid, &dent->fidlist, dlist) { |
89 | if (any || fid->uid == uid) { | 90 | if (any || uid_eq(fid->uid, uid)) { |
90 | ret = fid; | 91 | ret = fid; |
91 | break; | 92 | break; |
92 | } | 93 | } |
@@ -126,7 +127,7 @@ err_out: | |||
126 | } | 127 | } |
127 | 128 | ||
128 | static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry, | 129 | static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry, |
129 | uid_t uid, int any) | 130 | kuid_t uid, int any) |
130 | { | 131 | { |
131 | struct dentry *ds; | 132 | struct dentry *ds; |
132 | char **wnames, *uname; | 133 | char **wnames, *uname; |
@@ -233,7 +234,7 @@ err_out: | |||
233 | 234 | ||
234 | struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) | 235 | struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) |
235 | { | 236 | { |
236 | uid_t uid; | 237 | kuid_t uid; |
237 | int any, access; | 238 | int any, access; |
238 | struct v9fs_session_info *v9ses; | 239 | struct v9fs_session_info *v9ses; |
239 | 240 | ||
@@ -253,7 +254,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) | |||
253 | break; | 254 | break; |
254 | 255 | ||
255 | default: | 256 | default: |
256 | uid = ~0; | 257 | uid = INVALID_UID; |
257 | any = 0; | 258 | any = 0; |
258 | break; | 259 | break; |
259 | } | 260 | } |
@@ -272,7 +273,7 @@ struct p9_fid *v9fs_fid_clone(struct dentry *dentry) | |||
272 | return ret; | 273 | return ret; |
273 | } | 274 | } |
274 | 275 | ||
275 | static struct p9_fid *v9fs_fid_clone_with_uid(struct dentry *dentry, uid_t uid) | 276 | static struct p9_fid *v9fs_fid_clone_with_uid(struct dentry *dentry, kuid_t uid) |
276 | { | 277 | { |
277 | struct p9_fid *fid, *ret; | 278 | struct p9_fid *fid, *ret; |
278 | 279 | ||
@@ -289,7 +290,7 @@ struct p9_fid *v9fs_writeback_fid(struct dentry *dentry) | |||
289 | int err; | 290 | int err; |
290 | struct p9_fid *fid; | 291 | struct p9_fid *fid; |
291 | 292 | ||
292 | fid = v9fs_fid_clone_with_uid(dentry, 0); | 293 | fid = v9fs_fid_clone_with_uid(dentry, GLOBAL_ROOT_UID); |
293 | if (IS_ERR(fid)) | 294 | if (IS_ERR(fid)) |
294 | goto error_out; | 295 | goto error_out; |
295 | /* | 296 | /* |