aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/9p/v9fs.c2
-rw-r--r--include/net/9p/client.h10
-rw-r--r--net/9p/client.c25
3 files changed, 19 insertions, 18 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index d934f04e7736..4e0bd9d62ed6 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -375,7 +375,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
375 v9ses->flags &= ~V9FS_ACL_MASK; 375 v9ses->flags &= ~V9FS_ACL_MASK;
376 } 376 }
377 377
378 fid = p9_client_attach(v9ses->clnt, NULL, v9ses->uname, ~0, 378 fid = p9_client_attach(v9ses->clnt, NULL, v9ses->uname, INVALID_UID,
379 v9ses->aname); 379 v9ses->aname);
380 if (IS_ERR(fid)) { 380 if (IS_ERR(fid)) {
381 retval = PTR_ERR(fid); 381 retval = PTR_ERR(fid);
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index fc9b90b0c052..6b031ab6e4db 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -220,17 +220,17 @@ void p9_client_destroy(struct p9_client *clnt);
220void p9_client_disconnect(struct p9_client *clnt); 220void p9_client_disconnect(struct p9_client *clnt);
221void p9_client_begin_disconnect(struct p9_client *clnt); 221void p9_client_begin_disconnect(struct p9_client *clnt);
222struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, 222struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
223 char *uname, u32 n_uname, char *aname); 223 char *uname, kuid_t n_uname, char *aname);
224struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, 224struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
225 char **wnames, int clone); 225 char **wnames, int clone);
226int p9_client_open(struct p9_fid *fid, int mode); 226int p9_client_open(struct p9_fid *fid, int mode);
227int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, 227int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
228 char *extension); 228 char *extension);
229int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); 229int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname);
230int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, 230int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, kgid_t gid,
231 struct p9_qid *qid); 231 struct p9_qid *qid);
232int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, 232int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
233 gid_t gid, struct p9_qid *qid); 233 kgid_t gid, struct p9_qid *qid);
234int p9_client_clunk(struct p9_fid *fid); 234int p9_client_clunk(struct p9_fid *fid);
235int p9_client_fsync(struct p9_fid *fid, int datasync); 235int p9_client_fsync(struct p9_fid *fid, int datasync);
236int p9_client_remove(struct p9_fid *fid); 236int p9_client_remove(struct p9_fid *fid);
@@ -250,9 +250,9 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
250 u64 request_mask); 250 u64 request_mask);
251 251
252int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, 252int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode,
253 dev_t rdev, gid_t gid, struct p9_qid *); 253 dev_t rdev, kgid_t gid, struct p9_qid *);
254int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, 254int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
255 gid_t gid, struct p9_qid *); 255 kgid_t gid, struct p9_qid *);
256int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); 256int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
257int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); 257int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl);
258struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); 258struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
diff --git a/net/9p/client.c b/net/9p/client.c
index 34d417670935..17855f080acd 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1100,7 +1100,7 @@ void p9_client_begin_disconnect(struct p9_client *clnt)
1100EXPORT_SYMBOL(p9_client_begin_disconnect); 1100EXPORT_SYMBOL(p9_client_begin_disconnect);
1101 1101
1102struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, 1102struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
1103 char *uname, u32 n_uname, char *aname) 1103 char *uname, kuid_t n_uname, char *aname)
1104{ 1104{
1105 int err = 0; 1105 int err = 0;
1106 struct p9_req_t *req; 1106 struct p9_req_t *req;
@@ -1117,7 +1117,7 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
1117 goto error; 1117 goto error;
1118 } 1118 }
1119 1119
1120 req = p9_client_rpc(clnt, P9_TATTACH, "ddss?d", fid->fid, 1120 req = p9_client_rpc(clnt, P9_TATTACH, "ddss?u", fid->fid,
1121 afid ? afid->fid : P9_NOFID, uname, aname, n_uname); 1121 afid ? afid->fid : P9_NOFID, uname, aname, n_uname);
1122 if (IS_ERR(req)) { 1122 if (IS_ERR(req)) {
1123 err = PTR_ERR(req); 1123 err = PTR_ERR(req);
@@ -1270,7 +1270,7 @@ error:
1270EXPORT_SYMBOL(p9_client_open); 1270EXPORT_SYMBOL(p9_client_open);
1271 1271
1272int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, 1272int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
1273 gid_t gid, struct p9_qid *qid) 1273 kgid_t gid, struct p9_qid *qid)
1274{ 1274{
1275 int err = 0; 1275 int err = 0;
1276 struct p9_client *clnt; 1276 struct p9_client *clnt;
@@ -1279,13 +1279,14 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
1279 1279
1280 p9_debug(P9_DEBUG_9P, 1280 p9_debug(P9_DEBUG_9P,
1281 ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n", 1281 ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n",
1282 ofid->fid, name, flags, mode, gid); 1282 ofid->fid, name, flags, mode,
1283 from_kgid(&init_user_ns, gid));
1283 clnt = ofid->clnt; 1284 clnt = ofid->clnt;
1284 1285
1285 if (ofid->mode != -1) 1286 if (ofid->mode != -1)
1286 return -EINVAL; 1287 return -EINVAL;
1287 1288
1288 req = p9_client_rpc(clnt, P9_TLCREATE, "dsddd", ofid->fid, name, flags, 1289 req = p9_client_rpc(clnt, P9_TLCREATE, "dsddg", ofid->fid, name, flags,
1289 mode, gid); 1290 mode, gid);
1290 if (IS_ERR(req)) { 1291 if (IS_ERR(req)) {
1291 err = PTR_ERR(req); 1292 err = PTR_ERR(req);
@@ -1358,7 +1359,7 @@ error:
1358} 1359}
1359EXPORT_SYMBOL(p9_client_fcreate); 1360EXPORT_SYMBOL(p9_client_fcreate);
1360 1361
1361int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid, 1362int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, kgid_t gid,
1362 struct p9_qid *qid) 1363 struct p9_qid *qid)
1363{ 1364{
1364 int err = 0; 1365 int err = 0;
@@ -1369,7 +1370,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
1369 dfid->fid, name, symtgt); 1370 dfid->fid, name, symtgt);
1370 clnt = dfid->clnt; 1371 clnt = dfid->clnt;
1371 1372
1372 req = p9_client_rpc(clnt, P9_TSYMLINK, "dssd", dfid->fid, name, symtgt, 1373 req = p9_client_rpc(clnt, P9_TSYMLINK, "dssg", dfid->fid, name, symtgt,
1373 gid); 1374 gid);
1374 if (IS_ERR(req)) { 1375 if (IS_ERR(req)) {
1375 err = PTR_ERR(req); 1376 err = PTR_ERR(req);
@@ -2106,7 +2107,7 @@ error:
2106EXPORT_SYMBOL(p9_client_readdir); 2107EXPORT_SYMBOL(p9_client_readdir);
2107 2108
2108int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode, 2109int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
2109 dev_t rdev, gid_t gid, struct p9_qid *qid) 2110 dev_t rdev, kgid_t gid, struct p9_qid *qid)
2110{ 2111{
2111 int err; 2112 int err;
2112 struct p9_client *clnt; 2113 struct p9_client *clnt;
@@ -2116,7 +2117,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
2116 clnt = fid->clnt; 2117 clnt = fid->clnt;
2117 p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d " 2118 p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d "
2118 "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev)); 2119 "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev));
2119 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode, 2120 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddg", fid->fid, name, mode,
2120 MAJOR(rdev), MINOR(rdev), gid); 2121 MAJOR(rdev), MINOR(rdev), gid);
2121 if (IS_ERR(req)) 2122 if (IS_ERR(req))
2122 return PTR_ERR(req); 2123 return PTR_ERR(req);
@@ -2137,7 +2138,7 @@ error:
2137EXPORT_SYMBOL(p9_client_mknod_dotl); 2138EXPORT_SYMBOL(p9_client_mknod_dotl);
2138 2139
2139int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, 2140int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
2140 gid_t gid, struct p9_qid *qid) 2141 kgid_t gid, struct p9_qid *qid)
2141{ 2142{
2142 int err; 2143 int err;
2143 struct p9_client *clnt; 2144 struct p9_client *clnt;
@@ -2146,8 +2147,8 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
2146 err = 0; 2147 err = 0;
2147 clnt = fid->clnt; 2148 clnt = fid->clnt;
2148 p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n", 2149 p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n",
2149 fid->fid, name, mode, gid); 2150 fid->fid, name, mode, from_kgid(&init_user_ns, gid));
2150 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdd", fid->fid, name, mode, 2151 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdg", fid->fid, name, mode,
2151 gid); 2152 gid);
2152 if (IS_ERR(req)) 2153 if (IS_ERR(req))
2153 return PTR_ERR(req); 2154 return PTR_ERR(req);