Merge git://git.linux-nfs.org/pub/linux/nfs-2.6

* git://git.linux-nfs.org/pub/linux/nfs-2.6:
NFSv4: handle lack of clientaddr in option string
NFSv4: debug print ntohl(status) in nfs client callback xdr code
SUNRPC: Clean up the sillyrename code
NFS: Introduce struct nfs_removeargs+nfs_removeres
NFS: Use dentry->d_time to store the parent directory verifier.
SUNRPC: move bkl locking and xdr proc invocation into a common helper
NFSv4: Fix the nfsv4 readlink reply buffer alignment
NFSv4: Fix the readdir reply buffer alignment
NFSv4: More NFSv4 xdr cleanups
NFSv4: Try to recover from getfh failures in nfs4_xdr_dec_open
NFSv4: 'constify' lookup arguments.
NFSv4: Don't fail nfs4_xdr_dec_open if decode_restorefh() failed
NFSv4: Fix open state recovery
NFSD/SUNRPC: Fix the automatic selection of RPCSEC_GSS

+441 -406
+1 -1
fs/Kconfig
··· 1674 1675 config NFSD_V4 1676 bool "Provide NFSv4 server support (EXPERIMENTAL)" 1677 - depends on NFSD_V3 && EXPERIMENTAL 1678 select RPCSEC_GSS_KRB5 1679 help 1680 If you would like to include the NFSv4 server as well as the NFSv2
··· 1674 1675 config NFSD_V4 1676 bool "Provide NFSv4 server support (EXPERIMENTAL)" 1677 + depends on NFSD && NFSD_V3 && EXPERIMENTAL 1678 select RPCSEC_GSS_KRB5 1679 help 1680 If you would like to include the NFSv4 server as well as the NFSv2
+5 -5
fs/nfs/callback_xdr.c
··· 179 args->addr = svc_addr_in(rqstp); 180 status = decode_bitmap(xdr, args->bitmap); 181 out: 182 - dprintk("%s: exit with status = %d\n", __FUNCTION__, status); 183 return status; 184 } 185 ··· 200 args->truncate = ntohl(*p); 201 status = decode_fh(xdr, &args->fh); 202 out: 203 - dprintk("%s: exit with status = %d\n", __FUNCTION__, status); 204 return status; 205 } 206 ··· 349 status = encode_attr_mtime(xdr, res->bitmap, &res->mtime); 350 *savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1))); 351 out: 352 - dprintk("%s: exit with status = %d\n", __FUNCTION__, status); 353 return status; 354 } 355 ··· 392 status = res; 393 if (op->encode_res != NULL && status == 0) 394 status = op->encode_res(rqstp, xdr_out, resp); 395 - dprintk("%s: done, status = %d\n", __FUNCTION__, status); 396 return status; 397 } 398 ··· 431 } 432 *hdr_res.status = status; 433 *hdr_res.nops = htonl(nops); 434 - dprintk("%s: done, status = %u\n", __FUNCTION__, status); 435 return rpc_success; 436 } 437
··· 179 args->addr = svc_addr_in(rqstp); 180 status = decode_bitmap(xdr, args->bitmap); 181 out: 182 + dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); 183 return status; 184 } 185 ··· 200 args->truncate = ntohl(*p); 201 status = decode_fh(xdr, &args->fh); 202 out: 203 + dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); 204 return status; 205 } 206 ··· 349 status = encode_attr_mtime(xdr, res->bitmap, &res->mtime); 350 *savep = htonl((unsigned int)((char *)xdr->p - (char *)(savep+1))); 351 out: 352 + dprintk("%s: exit with status = %d\n", __FUNCTION__, ntohl(status)); 353 return status; 354 } 355 ··· 392 status = res; 393 if (op->encode_res != NULL && status == 0) 394 status = op->encode_res(rqstp, xdr_out, resp); 395 + dprintk("%s: done, status = %d\n", __FUNCTION__, ntohl(status)); 396 return status; 397 } 398 ··· 431 } 432 *hdr_res.status = status; 433 *hdr_res.nops = htonl(nops); 434 + dprintk("%s: done, status = %u\n", __FUNCTION__, ntohl(status)); 435 return rpc_success; 436 } 437
+4 -4
fs/nfs/dir.c
··· 654 655 if (IS_ROOT(dentry)) 656 return 1; 657 - verf = (unsigned long)dentry->d_fsdata; 658 if (nfs_caches_unstable(dir) 659 || verf != NFS_I(dir)->cache_change_attribute) 660 return 0; ··· 663 664 static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) 665 { 666 - dentry->d_fsdata = (void *)verf; 667 } 668 669 static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf) ··· 869 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 870 lock_kernel(); 871 drop_nlink(inode); 872 - nfs_complete_unlink(dentry); 873 unlock_kernel(); 874 } 875 /* When creating a negative dentry, we want to renew d_time */ ··· 1411 nfs_renew_times(dentry); 1412 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 1413 d_move(dentry, sdentry); 1414 - error = nfs_async_unlink(dentry); 1415 /* If we return 0 we don't unlink */ 1416 } 1417 dput(sdentry);
··· 654 655 if (IS_ROOT(dentry)) 656 return 1; 657 + verf = dentry->d_time; 658 if (nfs_caches_unstable(dir) 659 || verf != NFS_I(dir)->cache_change_attribute) 660 return 0; ··· 663 664 static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) 665 { 666 + dentry->d_time = verf; 667 } 668 669 static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf) ··· 869 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 870 lock_kernel(); 871 drop_nlink(inode); 872 + nfs_complete_unlink(dentry, inode); 873 unlock_kernel(); 874 } 875 /* When creating a negative dentry, we want to renew d_time */ ··· 1411 nfs_renew_times(dentry); 1412 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 1413 d_move(dentry, sdentry); 1414 + error = nfs_async_unlink(dir, dentry); 1415 /* If we return 0 we don't unlink */ 1416 } 1417 dput(sdentry);
+16 -3
fs/nfs/nfs2xdr.c
··· 43 #define NFS_entry_sz (NFS_filename_sz+3) 44 45 #define NFS_diropargs_sz (NFS_fhandle_sz+NFS_filename_sz) 46 #define NFS_sattrargs_sz (NFS_fhandle_sz+NFS_sattr_sz) 47 #define NFS_readlinkargs_sz (NFS_fhandle_sz) 48 #define NFS_readargs_sz (NFS_fhandle_sz+3) ··· 67 * Common NFS XDR functions as inlines 68 */ 69 static inline __be32 * 70 - xdr_encode_fhandle(__be32 *p, struct nfs_fh *fhandle) 71 { 72 memcpy(p, fhandle->data, NFS2_FHSIZE); 73 return p + XDR_QUADLEN(NFS2_FHSIZE); ··· 205 206 /* 207 * Encode directory ops argument 208 - * LOOKUP, REMOVE, RMDIR 209 */ 210 static int 211 nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args) 212 { 213 p = xdr_encode_fhandle(p, args->fh); 214 p = xdr_encode_array(p, args->name, args->len); 215 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 216 return 0; 217 } ··· 718 PROC(READ, readargs, readres, 3), 719 PROC(WRITE, writeargs, writeres, 4), 720 PROC(CREATE, createargs, diropres, 0), 721 - PROC(REMOVE, diropargs, stat, 0), 722 PROC(RENAME, renameargs, stat, 0), 723 PROC(LINK, linkargs, stat, 0), 724 PROC(SYMLINK, symlinkargs, stat, 0),
··· 43 #define NFS_entry_sz (NFS_filename_sz+3) 44 45 #define NFS_diropargs_sz (NFS_fhandle_sz+NFS_filename_sz) 46 + #define NFS_removeargs_sz (NFS_fhandle_sz+NFS_filename_sz) 47 #define NFS_sattrargs_sz (NFS_fhandle_sz+NFS_sattr_sz) 48 #define NFS_readlinkargs_sz (NFS_fhandle_sz) 49 #define NFS_readargs_sz (NFS_fhandle_sz+3) ··· 66 * Common NFS XDR functions as inlines 67 */ 68 static inline __be32 * 69 + xdr_encode_fhandle(__be32 *p, const struct nfs_fh *fhandle) 70 { 71 memcpy(p, fhandle->data, NFS2_FHSIZE); 72 return p + XDR_QUADLEN(NFS2_FHSIZE); ··· 204 205 /* 206 * Encode directory ops argument 207 + * LOOKUP, RMDIR 208 */ 209 static int 210 nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args) 211 { 212 p = xdr_encode_fhandle(p, args->fh); 213 p = xdr_encode_array(p, args->name, args->len); 214 + req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 215 + return 0; 216 + } 217 + 218 + /* 219 + * Encode REMOVE argument 220 + */ 221 + static int 222 + nfs_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args) 223 + { 224 + p = xdr_encode_fhandle(p, args->fh); 225 + p = xdr_encode_array(p, args->name.name, args->name.len); 226 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 227 return 0; 228 } ··· 705 PROC(READ, readargs, readres, 3), 706 PROC(WRITE, writeargs, writeres, 4), 707 PROC(CREATE, createargs, diropres, 0), 708 + PROC(REMOVE, removeargs, stat, 0), 709 PROC(RENAME, renameargs, stat, 0), 710 PROC(LINK, linkargs, stat, 0), 711 PROC(SYMLINK, symlinkargs, stat, 0),
+20 -40
fs/nfs/nfs3proc.c
··· 349 static int 350 nfs3_proc_remove(struct inode *dir, struct qstr *name) 351 { 352 - struct nfs_fattr dir_attr; 353 - struct nfs3_diropargs arg = { 354 - .fh = NFS_FH(dir), 355 - .name = name->name, 356 - .len = name->len 357 }; 358 - struct rpc_message msg = { 359 - .rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE], 360 - .rpc_argp = &arg, 361 - .rpc_resp = &dir_attr, 362 }; 363 int status; 364 365 dprintk("NFS call remove %s\n", name->name); 366 - nfs_fattr_init(&dir_attr); 367 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 368 - nfs_post_op_update_inode(dir, &dir_attr); 369 dprintk("NFS reply remove: %d\n", status); 370 return status; 371 } 372 373 - static int 374 - nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name) 375 { 376 - struct unlinkxdr { 377 - struct nfs3_diropargs arg; 378 - struct nfs_fattr res; 379 - } *ptr; 380 - 381 - ptr = kmalloc(sizeof(*ptr), GFP_KERNEL); 382 - if (!ptr) 383 - return -ENOMEM; 384 - ptr->arg.fh = NFS_FH(dir->d_inode); 385 - ptr->arg.name = name->name; 386 - ptr->arg.len = name->len; 387 - nfs_fattr_init(&ptr->res); 388 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; 389 - msg->rpc_argp = &ptr->arg; 390 - msg->rpc_resp = &ptr->res; 391 - return 0; 392 } 393 394 static int 395 - nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task) 396 { 397 - struct rpc_message *msg = &task->tk_msg; 398 - struct nfs_fattr *dir_attr; 399 - 400 - if (nfs3_async_handle_jukebox(task, dir->d_inode)) 401 - return 1; 402 - if (msg->rpc_argp) { 403 - dir_attr = (struct nfs_fattr*)msg->rpc_resp; 404 - nfs_post_op_update_inode(dir->d_inode, dir_attr); 405 - kfree(msg->rpc_argp); 406 - } 407 - return 0; 408 } 409 410 static int
··· 349 static int 350 nfs3_proc_remove(struct inode *dir, struct qstr *name) 351 { 352 + struct nfs_removeargs arg = { 353 + .fh = NFS_FH(dir), 354 + .name.len = name->len, 355 + .name.name = name->name, 356 }; 357 + struct nfs_removeres res; 358 + struct rpc_message msg = { 359 + .rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE], 360 + .rpc_argp = &arg, 361 + .rpc_resp = &res, 362 }; 363 int status; 364 365 dprintk("NFS call remove %s\n", name->name); 366 + nfs_fattr_init(&res.dir_attr); 367 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 368 + nfs_post_op_update_inode(dir, &res.dir_attr); 369 dprintk("NFS reply remove: %d\n", status); 370 return status; 371 } 372 373 + static void 374 + nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) 375 { 376 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; 377 } 378 379 static int 380 + nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir) 381 { 382 + struct nfs_removeres *res; 383 + if (nfs3_async_handle_jukebox(task, dir)) 384 + return 0; 385 + res = task->tk_msg.rpc_resp; 386 + nfs_post_op_update_inode(dir, &res->dir_attr); 387 + return 1; 388 } 389 390 static int
+22 -2
fs/nfs/nfs3xdr.c
··· 50 51 #define NFS3_sattrargs_sz (NFS3_fh_sz+NFS3_sattr_sz+3) 52 #define NFS3_diropargs_sz (NFS3_fh_sz+NFS3_filename_sz) 53 #define NFS3_accessargs_sz (NFS3_fh_sz+1) 54 #define NFS3_readlinkargs_sz (NFS3_fh_sz) 55 #define NFS3_readargs_sz (NFS3_fh_sz+3) ··· 66 67 #define NFS3_attrstat_sz (1+NFS3_fattr_sz) 68 #define NFS3_wccstat_sz (1+NFS3_wcc_data_sz) 69 #define NFS3_lookupres_sz (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz)) 70 #define NFS3_accessres_sz (1+NFS3_post_op_attr_sz+1) 71 #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1) ··· 108 * Common NFS XDR functions as inlines 109 */ 110 static inline __be32 * 111 - xdr_encode_fhandle(__be32 *p, struct nfs_fh *fh) 112 { 113 return xdr_encode_array(p, fh->data, fh->size); 114 } ··· 297 { 298 p = xdr_encode_fhandle(p, args->fh); 299 p = xdr_encode_array(p, args->name, args->len); 300 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 301 return 0; 302 } ··· 750 return status; 751 } 752 753 /* 754 * Decode LOOKUP reply 755 */ ··· 1146 PROC(MKDIR, mkdirargs, createres, 0), 1147 PROC(SYMLINK, symlinkargs, createres, 0), 1148 PROC(MKNOD, mknodargs, createres, 0), 1149 - PROC(REMOVE, diropargs, wccstat, 0), 1150 PROC(RMDIR, diropargs, wccstat, 0), 1151 PROC(RENAME, renameargs, renameres, 0), 1152 PROC(LINK, linkargs, linkres, 0),
··· 50 51 #define NFS3_sattrargs_sz (NFS3_fh_sz+NFS3_sattr_sz+3) 52 #define NFS3_diropargs_sz (NFS3_fh_sz+NFS3_filename_sz) 53 + #define NFS3_removeargs_sz (NFS3_fh_sz+NFS3_filename_sz) 54 #define NFS3_accessargs_sz (NFS3_fh_sz+1) 55 #define NFS3_readlinkargs_sz (NFS3_fh_sz) 56 #define NFS3_readargs_sz (NFS3_fh_sz+3) ··· 65 66 #define NFS3_attrstat_sz (1+NFS3_fattr_sz) 67 #define NFS3_wccstat_sz (1+NFS3_wcc_data_sz) 68 + #define NFS3_removeres_sz (NFS3_wccstat_sz) 69 #define NFS3_lookupres_sz (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz)) 70 #define NFS3_accessres_sz (1+NFS3_post_op_attr_sz+1) 71 #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1) ··· 106 * Common NFS XDR functions as inlines 107 */ 108 static inline __be32 * 109 + xdr_encode_fhandle(__be32 *p, const struct nfs_fh *fh) 110 { 111 return xdr_encode_array(p, fh->data, fh->size); 112 } ··· 295 { 296 p = xdr_encode_fhandle(p, args->fh); 297 p = xdr_encode_array(p, args->name, args->len); 298 + req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 299 + return 0; 300 + } 301 + 302 + /* 303 + * Encode REMOVE argument 304 + */ 305 + static int 306 + nfs3_xdr_removeargs(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args) 307 + { 308 + p = xdr_encode_fhandle(p, args->fh); 309 + p = xdr_encode_array(p, args->name.name, args->name.len); 310 req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); 311 return 0; 312 } ··· 736 return status; 737 } 738 739 + static int 740 + nfs3_xdr_removeres(struct rpc_rqst *req, __be32 *p, struct nfs_removeres *res) 741 + { 742 + return nfs3_xdr_wccstat(req, p, &res->dir_attr); 743 + } 744 + 745 /* 746 * Decode LOOKUP reply 747 */ ··· 1126 PROC(MKDIR, mkdirargs, createres, 0), 1127 PROC(SYMLINK, symlinkargs, createres, 0), 1128 PROC(MKNOD, mknodargs, createres, 0), 1129 + PROC(REMOVE, removeargs, removeres, 0), 1130 PROC(RMDIR, diropargs, wccstat, 0), 1131 PROC(RENAME, renameargs, renameres, 0), 1132 PROC(LINK, linkargs, linkres, 0),
+1 -1
fs/nfs/nfs4_fs.h
··· 182 extern struct dentry *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *); 183 extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nameidata *); 184 extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); 185 - extern int nfs4_proc_fs_locations(struct inode *dir, struct qstr *name, 186 struct nfs4_fs_locations *fs_locations, struct page *page); 187 188 extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops;
··· 182 extern struct dentry *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *); 183 extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nameidata *); 184 extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); 185 + extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, 186 struct nfs4_fs_locations *fs_locations, struct page *page); 187 188 extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops;
+58 -64
fs/nfs/nfs4proc.c
··· 66 static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception); 67 static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp); 68 static int _nfs4_do_access(struct inode *inode, struct rpc_cred *cred, int openflags); 69 70 /* Prevent leaks of NFSv4 errors into userland */ 71 int nfs4_map_errors(int err) ··· 554 return ERR_PTR(-ENOENT); 555 } 556 557 static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, mode_t openflags, struct nfs4_state **res) 558 { 559 struct nfs4_state *newstate; ··· 640 int delegation_type = 0; 641 int status; 642 643 - opendata = nfs4_opendata_alloc(&ctx->path, state->owner, 0, NULL); 644 - if (opendata == NULL) 645 - return -ENOMEM; 646 opendata->o_arg.claim = NFS4_OPEN_CLAIM_PREVIOUS; 647 opendata->o_arg.fh = NFS_FH(state->inode); 648 - nfs_copy_fh(&opendata->o_res.fh, opendata->o_arg.fh); 649 rcu_read_lock(); 650 delegation = rcu_dereference(NFS_I(state->inode)->delegation); 651 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0) ··· 685 686 static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) 687 { 688 - struct nfs4_state_owner *sp = state->owner; 689 struct nfs4_opendata *opendata; 690 int ret; 691 692 - opendata = nfs4_opendata_alloc(&ctx->path, sp, 0, NULL); 693 - if (opendata == NULL) 694 - return -ENOMEM; 695 opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; 696 memcpy(opendata->o_arg.u.delegation.data, stateid->data, 697 sizeof(opendata->o_arg.u.delegation.data)); ··· 835 /* Update sequence id. */ 836 data->o_arg.id = sp->so_owner_id.id; 837 data->o_arg.clientid = sp->so_client->cl_clientid; 838 - if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) 839 msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; 840 data->timestamp = jiffies; 841 rpc_call_setup(task, &msg, 0); 842 return; ··· 932 if (status != 0 || !data->rpc_done) 933 return status; 934 935 if (o_arg->open_flags & O_CREAT) { 936 update_changeattr(dir, &o_res->cinfo); 937 nfs_post_op_update_inode(dir, o_res->dir_attr); ··· 946 return status; 947 } 948 if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) 949 - return server->nfs_client->rpc_ops->getattr(server, &o_res->fh, o_res->f_attr); 950 return 0; 951 } 952 ··· 1006 struct nfs4_opendata *opendata; 1007 int ret; 1008 1009 - opendata = nfs4_opendata_alloc(&ctx->path, state->owner, 0, NULL); 1010 - if (opendata == NULL) 1011 - return -ENOMEM; 1012 ret = nfs4_open_recover(opendata, state); 1013 if (ret == -ESTALE) { 1014 /* Invalidate the state owner so we don't ever use it again */ ··· 1570 * Note that we'll actually follow the referral later when 1571 * we detect fsid mismatch in inode revalidation 1572 */ 1573 - static int nfs4_get_referral(struct inode *dir, struct qstr *name, struct nfs_fattr *fattr, struct nfs_fh *fhandle) 1574 { 1575 int status = -ENOMEM; 1576 struct page *page = NULL; ··· 1685 return status; 1686 } 1687 1688 - static int _nfs4_proc_lookupfh(struct nfs_server *server, struct nfs_fh *dirfh, 1689 - struct qstr *name, struct nfs_fh *fhandle, 1690 struct nfs_fattr *fattr) 1691 { 1692 int status; ··· 1732 return err; 1733 } 1734 1735 - static int _nfs4_proc_lookup(struct inode *dir, struct qstr *name, 1736 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 1737 { 1738 int status; ··· 1925 static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) 1926 { 1927 struct nfs_server *server = NFS_SERVER(dir); 1928 - struct nfs4_remove_arg args = { 1929 .fh = NFS_FH(dir), 1930 - .name = name, 1931 .bitmask = server->attr_bitmask, 1932 }; 1933 - struct nfs_fattr dir_attr; 1934 - struct nfs4_remove_res res = { 1935 .server = server, 1936 - .dir_attr = &dir_attr, 1937 }; 1938 struct rpc_message msg = { 1939 - .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE], 1940 - .rpc_argp = &args, 1941 - .rpc_resp = &res, 1942 }; 1943 int status; 1944 1945 - nfs_fattr_init(res.dir_attr); 1946 status = rpc_call_sync(server->client, &msg, 0); 1947 if (status == 0) { 1948 update_changeattr(dir, &res.cinfo); 1949 - nfs_post_op_update_inode(dir, res.dir_attr); 1950 } 1951 return status; 1952 } ··· 1962 return err; 1963 } 1964 1965 - struct unlink_desc { 1966 - struct nfs4_remove_arg args; 1967 - struct nfs4_remove_res res; 1968 - struct nfs_fattr dir_attr; 1969 - }; 1970 - 1971 - static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, 1972 - struct qstr *name) 1973 { 1974 - struct nfs_server *server = NFS_SERVER(dir->d_inode); 1975 - struct unlink_desc *up; 1976 1977 - up = kmalloc(sizeof(*up), GFP_KERNEL); 1978 - if (!up) 1979 - return -ENOMEM; 1980 - 1981 - up->args.fh = NFS_FH(dir->d_inode); 1982 - up->args.name = name; 1983 - up->args.bitmask = server->attr_bitmask; 1984 - up->res.server = server; 1985 - up->res.dir_attr = &up->dir_attr; 1986 - 1987 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; 1988 - msg->rpc_argp = &up->args; 1989 - msg->rpc_resp = &up->res; 1990 - return 0; 1991 } 1992 1993 - static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task) 1994 { 1995 - struct rpc_message *msg = &task->tk_msg; 1996 - struct unlink_desc *up; 1997 - 1998 - if (msg->rpc_resp != NULL) { 1999 - up = container_of(msg->rpc_resp, struct unlink_desc, res); 2000 - update_changeattr(dir->d_inode, &up->res.cinfo); 2001 - nfs_post_op_update_inode(dir->d_inode, up->res.dir_attr); 2002 - kfree(up); 2003 - msg->rpc_resp = NULL; 2004 - msg->rpc_argp = NULL; 2005 - } 2006 - return 0; 2007 } 2008 2009 static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, ··· 3666 return len; 3667 } 3668 3669 - int nfs4_proc_fs_locations(struct inode *dir, struct qstr *name, 3670 struct nfs4_fs_locations *fs_locations, struct page *page) 3671 { 3672 struct nfs_server *server = NFS_SERVER(dir);
··· 66 static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception); 67 static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp); 68 static int _nfs4_do_access(struct inode *inode, struct rpc_cred *cred, int openflags); 69 + static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr); 70 + static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr); 71 72 /* Prevent leaks of NFSv4 errors into userland */ 73 int nfs4_map_errors(int err) ··· 552 return ERR_PTR(-ENOENT); 553 } 554 555 + static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context *ctx, struct nfs4_state *state) 556 + { 557 + struct nfs4_opendata *opendata; 558 + 559 + opendata = nfs4_opendata_alloc(&ctx->path, state->owner, 0, NULL); 560 + if (opendata == NULL) 561 + return ERR_PTR(-ENOMEM); 562 + opendata->state = state; 563 + atomic_inc(&state->count); 564 + return opendata; 565 + } 566 + 567 static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, mode_t openflags, struct nfs4_state **res) 568 { 569 struct nfs4_state *newstate; ··· 626 int delegation_type = 0; 627 int status; 628 629 + opendata = nfs4_open_recoverdata_alloc(ctx, state); 630 + if (IS_ERR(opendata)) 631 + return PTR_ERR(opendata); 632 opendata->o_arg.claim = NFS4_OPEN_CLAIM_PREVIOUS; 633 opendata->o_arg.fh = NFS_FH(state->inode); 634 rcu_read_lock(); 635 delegation = rcu_dereference(NFS_I(state->inode)->delegation); 636 if (delegation != NULL && (delegation->flags & NFS_DELEGATION_NEED_RECLAIM) != 0) ··· 672 673 static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) 674 { 675 struct nfs4_opendata *opendata; 676 int ret; 677 678 + opendata = nfs4_open_recoverdata_alloc(ctx, state); 679 + if (IS_ERR(opendata)) 680 + return PTR_ERR(opendata); 681 opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; 682 memcpy(opendata->o_arg.u.delegation.data, stateid->data, 683 sizeof(opendata->o_arg.u.delegation.data)); ··· 823 /* Update sequence id. */ 824 data->o_arg.id = sp->so_owner_id.id; 825 data->o_arg.clientid = sp->so_client->cl_clientid; 826 + if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) { 827 msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; 828 + nfs_copy_fh(&data->o_res.fh, data->o_arg.fh); 829 + } 830 data->timestamp = jiffies; 831 rpc_call_setup(task, &msg, 0); 832 return; ··· 918 if (status != 0 || !data->rpc_done) 919 return status; 920 921 + if (o_res->fh.size == 0) 922 + _nfs4_proc_lookup(dir, o_arg->name, &o_res->fh, o_res->f_attr); 923 + 924 if (o_arg->open_flags & O_CREAT) { 925 update_changeattr(dir, &o_res->cinfo); 926 nfs_post_op_update_inode(dir, o_res->dir_attr); ··· 929 return status; 930 } 931 if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) 932 + _nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr); 933 return 0; 934 } 935 ··· 989 struct nfs4_opendata *opendata; 990 int ret; 991 992 + opendata = nfs4_open_recoverdata_alloc(ctx, state); 993 + if (IS_ERR(opendata)) 994 + return PTR_ERR(opendata); 995 ret = nfs4_open_recover(opendata, state); 996 if (ret == -ESTALE) { 997 /* Invalidate the state owner so we don't ever use it again */ ··· 1553 * Note that we'll actually follow the referral later when 1554 * we detect fsid mismatch in inode revalidation 1555 */ 1556 + static int nfs4_get_referral(struct inode *dir, const struct qstr *name, struct nfs_fattr *fattr, struct nfs_fh *fhandle) 1557 { 1558 int status = -ENOMEM; 1559 struct page *page = NULL; ··· 1668 return status; 1669 } 1670 1671 + static int _nfs4_proc_lookupfh(struct nfs_server *server, const struct nfs_fh *dirfh, 1672 + const struct qstr *name, struct nfs_fh *fhandle, 1673 struct nfs_fattr *fattr) 1674 { 1675 int status; ··· 1715 return err; 1716 } 1717 1718 + static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, 1719 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 1720 { 1721 int status; ··· 1908 static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) 1909 { 1910 struct nfs_server *server = NFS_SERVER(dir); 1911 + struct nfs_removeargs args = { 1912 .fh = NFS_FH(dir), 1913 + .name.len = name->len, 1914 + .name.name = name->name, 1915 .bitmask = server->attr_bitmask, 1916 }; 1917 + struct nfs_removeres res = { 1918 .server = server, 1919 }; 1920 struct rpc_message msg = { 1921 + .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE], 1922 + .rpc_argp = &args, 1923 + .rpc_resp = &res, 1924 }; 1925 int status; 1926 1927 + nfs_fattr_init(&res.dir_attr); 1928 status = rpc_call_sync(server->client, &msg, 0); 1929 if (status == 0) { 1930 update_changeattr(dir, &res.cinfo); 1931 + nfs_post_op_update_inode(dir, &res.dir_attr); 1932 } 1933 return status; 1934 } ··· 1946 return err; 1947 } 1948 1949 + static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) 1950 { 1951 + struct nfs_server *server = NFS_SERVER(dir); 1952 + struct nfs_removeargs *args = msg->rpc_argp; 1953 + struct nfs_removeres *res = msg->rpc_resp; 1954 1955 + args->bitmask = server->attr_bitmask; 1956 + res->server = server; 1957 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; 1958 } 1959 1960 + static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir) 1961 { 1962 + struct nfs_removeres *res = task->tk_msg.rpc_resp; 1963 + 1964 + if (nfs4_async_handle_error(task, res->server) == -EAGAIN) 1965 + return 0; 1966 + update_changeattr(dir, &res->cinfo); 1967 + nfs_post_op_update_inode(dir, &res->dir_attr); 1968 + return 1; 1969 } 1970 1971 static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, ··· 3672 return len; 3673 } 3674 3675 + int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, 3676 struct nfs4_fs_locations *fs_locations, struct page *page) 3677 { 3678 struct nfs_server *server = NFS_SERVER(dir);
+168 -106
fs/nfs/nfs4xdr.c
··· 72 */ 73 #define open_owner_id_maxsz (1 + 4) 74 #define lock_owner_id_maxsz (1 + 4) 75 #define compound_encode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 76 #define compound_decode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 77 #define op_encode_hdr_maxsz (1) 78 #define op_decode_hdr_maxsz (2) 79 #define encode_putfh_maxsz (op_encode_hdr_maxsz + 1 + \ 80 (NFS4_FHSIZE >> 2)) 81 #define decode_putfh_maxsz (op_decode_hdr_maxsz) ··· 101 #define nfs4_fattr_maxsz (nfs4_fattr_bitmap_maxsz + \ 102 nfs4_fattr_value_maxsz) 103 #define decode_getattr_maxsz (op_decode_hdr_maxsz + nfs4_fattr_maxsz) 104 #define encode_savefh_maxsz (op_encode_hdr_maxsz) 105 #define decode_savefh_maxsz (op_decode_hdr_maxsz) 106 #define encode_restorefh_maxsz (op_encode_hdr_maxsz) ··· 133 #define decode_lookup_maxsz (op_decode_hdr_maxsz) 134 #define encode_share_access_maxsz \ 135 (2) 136 - #define encode_createmode_maxsz (1 + nfs4_fattr_maxsz) 137 #define encode_opentype_maxsz (1 + encode_createmode_maxsz) 138 #define encode_claim_null_maxsz (1 + nfs4_name_maxsz) 139 #define encode_open_maxsz (op_encode_hdr_maxsz + \ ··· 142 encode_opentype_maxsz + \ 143 encode_claim_null_maxsz) 144 #define decode_ace_maxsz (3 + nfs4_owner_maxsz) 145 - #define decode_delegation_maxsz (1 + XDR_QUADLEN(NFS4_STATEID_SIZE) + 1 + \ 146 decode_ace_maxsz) 147 #define decode_change_info_maxsz (5) 148 #define decode_open_maxsz (op_decode_hdr_maxsz + \ 149 - XDR_QUADLEN(NFS4_STATEID_SIZE) + \ 150 decode_change_info_maxsz + 1 + \ 151 nfs4_fattr_bitmap_maxsz + \ 152 decode_delegation_maxsz) 153 #define encode_remove_maxsz (op_encode_hdr_maxsz + \ 154 nfs4_name_maxsz) 155 #define encode_rename_maxsz (op_encode_hdr_maxsz + \ ··· 196 #define encode_link_maxsz (op_encode_hdr_maxsz + \ 197 nfs4_name_maxsz) 198 #define decode_link_maxsz (op_decode_hdr_maxsz + 5) 199 #define encode_symlink_maxsz (op_encode_hdr_maxsz + \ 200 1 + nfs4_name_maxsz + \ 201 1 + \ 202 nfs4_fattr_maxsz) 203 #define decode_symlink_maxsz (op_decode_hdr_maxsz + 8) 204 #define encode_create_maxsz (op_encode_hdr_maxsz + \ 205 - 2 + nfs4_name_maxsz + \ 206 - nfs4_fattr_maxsz) 207 #define decode_create_maxsz (op_decode_hdr_maxsz + \ 208 decode_change_info_maxsz + \ 209 nfs4_fattr_bitmap_maxsz) 210 #define encode_delegreturn_maxsz (op_encode_hdr_maxsz + 4) 211 #define decode_delegreturn_maxsz (op_decode_hdr_maxsz) 212 #define encode_fs_locations_maxsz \ 213 (encode_getattr_maxsz) 214 #define decode_fs_locations_maxsz \ ··· 242 #define NFS4_dec_compound_sz (1024) /* XXX: large enough? */ 243 #define NFS4_enc_read_sz (compound_encode_hdr_maxsz + \ 244 encode_putfh_maxsz + \ 245 - op_encode_hdr_maxsz + 7) 246 #define NFS4_dec_read_sz (compound_decode_hdr_maxsz + \ 247 decode_putfh_maxsz + \ 248 - op_decode_hdr_maxsz + 2) 249 #define NFS4_enc_readlink_sz (compound_encode_hdr_maxsz + \ 250 encode_putfh_maxsz + \ 251 - op_encode_hdr_maxsz) 252 #define NFS4_dec_readlink_sz (compound_decode_hdr_maxsz + \ 253 decode_putfh_maxsz + \ 254 - op_decode_hdr_maxsz) 255 #define NFS4_enc_readdir_sz (compound_encode_hdr_maxsz + \ 256 encode_putfh_maxsz + \ 257 - op_encode_hdr_maxsz + 9) 258 #define NFS4_dec_readdir_sz (compound_decode_hdr_maxsz + \ 259 decode_putfh_maxsz + \ 260 - op_decode_hdr_maxsz + 2) 261 #define NFS4_enc_write_sz (compound_encode_hdr_maxsz + \ 262 encode_putfh_maxsz + \ 263 - op_encode_hdr_maxsz + 8 + \ 264 encode_getattr_maxsz) 265 #define NFS4_dec_write_sz (compound_decode_hdr_maxsz + \ 266 decode_putfh_maxsz + \ 267 - op_decode_hdr_maxsz + 4 + \ 268 decode_getattr_maxsz) 269 #define NFS4_enc_commit_sz (compound_encode_hdr_maxsz + \ 270 encode_putfh_maxsz + \ 271 - op_encode_hdr_maxsz + 3 + \ 272 encode_getattr_maxsz) 273 #define NFS4_dec_commit_sz (compound_decode_hdr_maxsz + \ 274 decode_putfh_maxsz + \ 275 - op_decode_hdr_maxsz + 2 + \ 276 decode_getattr_maxsz) 277 #define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \ 278 encode_putfh_maxsz + \ ··· 290 decode_getattr_maxsz + \ 291 decode_restorefh_maxsz + \ 292 decode_getattr_maxsz) 293 - #define NFS4_enc_open_confirm_sz \ 294 - (compound_encode_hdr_maxsz + \ 295 - encode_putfh_maxsz + \ 296 - op_encode_hdr_maxsz + 5) 297 - #define NFS4_dec_open_confirm_sz (compound_decode_hdr_maxsz + \ 298 - decode_putfh_maxsz + \ 299 - op_decode_hdr_maxsz + 4) 300 #define NFS4_enc_open_noattr_sz (compound_encode_hdr_maxsz + \ 301 encode_putfh_maxsz + \ 302 encode_open_maxsz + \ ··· 308 decode_getattr_maxsz) 309 #define NFS4_enc_open_downgrade_sz \ 310 (compound_encode_hdr_maxsz + \ 311 - encode_putfh_maxsz + \ 312 - op_encode_hdr_maxsz + 7 + \ 313 - encode_getattr_maxsz) 314 #define NFS4_dec_open_downgrade_sz \ 315 (compound_decode_hdr_maxsz + \ 316 - decode_putfh_maxsz + \ 317 - op_decode_hdr_maxsz + 4 + \ 318 - decode_getattr_maxsz) 319 - #define NFS4_enc_close_sz (compound_encode_hdr_maxsz + \ 320 - encode_putfh_maxsz + \ 321 - op_encode_hdr_maxsz + 5 + \ 322 - encode_getattr_maxsz) 323 - #define NFS4_dec_close_sz (compound_decode_hdr_maxsz + \ 324 - decode_putfh_maxsz + \ 325 - op_decode_hdr_maxsz + 4 + \ 326 - decode_getattr_maxsz) 327 - #define NFS4_enc_setattr_sz (compound_encode_hdr_maxsz + \ 328 - encode_putfh_maxsz + \ 329 - op_encode_hdr_maxsz + 4 + \ 330 - nfs4_fattr_maxsz + \ 331 - encode_getattr_maxsz) 332 - #define NFS4_dec_setattr_sz (compound_decode_hdr_maxsz + \ 333 - decode_putfh_maxsz + \ 334 - op_decode_hdr_maxsz + 3 + \ 335 - nfs4_fattr_maxsz) 336 #define NFS4_enc_fsinfo_sz (compound_encode_hdr_maxsz + \ 337 encode_putfh_maxsz + \ 338 encode_fsinfo_maxsz) ··· 358 decode_fsinfo_maxsz) 359 #define NFS4_enc_lock_sz (compound_encode_hdr_maxsz + \ 360 encode_putfh_maxsz + \ 361 - encode_getattr_maxsz + \ 362 - op_encode_hdr_maxsz + \ 363 - 1 + 1 + 2 + 2 + \ 364 - 1 + 4 + 1 + 2 + \ 365 - lock_owner_id_maxsz) 366 #define NFS4_dec_lock_sz (compound_decode_hdr_maxsz + \ 367 decode_putfh_maxsz + \ 368 - decode_getattr_maxsz + \ 369 - op_decode_hdr_maxsz + \ 370 - 2 + 2 + 1 + 2 + \ 371 - lock_owner_id_maxsz) 372 #define NFS4_enc_lockt_sz (compound_encode_hdr_maxsz + \ 373 encode_putfh_maxsz + \ 374 - encode_getattr_maxsz + \ 375 - op_encode_hdr_maxsz + \ 376 - 1 + 2 + 2 + 2 + \ 377 - lock_owner_id_maxsz) 378 - #define NFS4_dec_lockt_sz (NFS4_dec_lock_sz) 379 #define NFS4_enc_locku_sz (compound_encode_hdr_maxsz + \ 380 encode_putfh_maxsz + \ 381 - encode_getattr_maxsz + \ 382 - op_encode_hdr_maxsz + \ 383 - 1 + 1 + 4 + 2 + 2) 384 #define NFS4_dec_locku_sz (compound_decode_hdr_maxsz + \ 385 decode_putfh_maxsz + \ 386 - decode_getattr_maxsz + \ 387 - op_decode_hdr_maxsz + 4) 388 #define NFS4_enc_access_sz (compound_encode_hdr_maxsz + \ 389 encode_putfh_maxsz + \ 390 - op_encode_hdr_maxsz + 1) 391 #define NFS4_dec_access_sz (compound_decode_hdr_maxsz + \ 392 decode_putfh_maxsz + \ 393 - op_decode_hdr_maxsz + 2) 394 #define NFS4_enc_getattr_sz (compound_encode_hdr_maxsz + \ 395 encode_putfh_maxsz + \ 396 encode_getattr_maxsz) ··· 478 decode_getattr_maxsz) 479 #define NFS4_enc_statfs_sz (compound_encode_hdr_maxsz + \ 480 encode_putfh_maxsz + \ 481 - encode_getattr_maxsz) 482 #define NFS4_dec_statfs_sz (compound_decode_hdr_maxsz + \ 483 decode_putfh_maxsz + \ 484 - op_decode_hdr_maxsz + 12) 485 #define NFS4_enc_server_caps_sz (compound_encode_hdr_maxsz + \ 486 encode_putfh_maxsz + \ 487 encode_getattr_maxsz) ··· 497 decode_getattr_maxsz) 498 #define NFS4_enc_getacl_sz (compound_encode_hdr_maxsz + \ 499 encode_putfh_maxsz + \ 500 - encode_getattr_maxsz) 501 #define NFS4_dec_getacl_sz (compound_decode_hdr_maxsz + \ 502 decode_putfh_maxsz + \ 503 - op_decode_hdr_maxsz + \ 504 - nfs4_fattr_bitmap_maxsz + 1) 505 #define NFS4_enc_setacl_sz (compound_encode_hdr_maxsz + \ 506 encode_putfh_maxsz + \ 507 - op_encode_hdr_maxsz + 4 + \ 508 - nfs4_fattr_bitmap_maxsz + 1) 509 #define NFS4_dec_setacl_sz (compound_decode_hdr_maxsz + \ 510 decode_putfh_maxsz + \ 511 - op_decode_hdr_maxsz + nfs4_fattr_bitmap_maxsz) 512 #define NFS4_enc_fs_locations_sz \ 513 (compound_encode_hdr_maxsz + \ 514 encode_putfh_maxsz + \ ··· 1168 1169 static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req) 1170 { 1171 - struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1172 uint32_t attrs[2] = { 1173 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, 1174 FATTR4_WORD1_MOUNTED_ON_FILEID, 1175 }; 1176 - int replen; 1177 __be32 *p; 1178 1179 RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20); ··· 1196 attrs[0] & readdir->bitmask[0], 1197 attrs[1] & readdir->bitmask[1]); 1198 1199 - /* set up reply kvec 1200 - * toplevel_status + taglen + rescount + OP_PUTFH + status 1201 - * + OP_READDIR + status + verifer(2) = 9 1202 - */ 1203 - replen = (RPC_REPHDRSIZE + auth->au_rslack + 9) << 2; 1204 - xdr_inline_pages(&req->rq_rcv_buf, replen, readdir->pages, 1205 - readdir->pgbase, readdir->count); 1206 - dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", 1207 - __FUNCTION__, replen, readdir->pages, 1208 - readdir->pgbase, readdir->count); 1209 - 1210 return 0; 1211 } 1212 1213 static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req) 1214 { 1215 - struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1216 - unsigned int replen; 1217 __be32 *p; 1218 1219 RESERVE_SPACE(4); 1220 WRITE32(OP_READLINK); 1221 1222 - /* set up reply kvec 1223 - * toplevel_status + taglen + rescount + OP_PUTFH + status 1224 - * + OP_READLINK + status + string length = 8 1225 - */ 1226 - replen = (RPC_REPHDRSIZE + auth->au_rslack + 8) << 2; 1227 - xdr_inline_pages(&req->rq_rcv_buf, replen, readlink->pages, 1228 - readlink->pgbase, readlink->pglen); 1229 - 1230 return 0; 1231 } 1232 ··· 1435 /* 1436 * Encode REMOVE request 1437 */ 1438 - static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs4_remove_arg *args) 1439 { 1440 struct xdr_stream xdr; 1441 struct compound_hdr hdr = { ··· 1447 encode_compound_hdr(&xdr, &hdr); 1448 if ((status = encode_putfh(&xdr, args->fh)) != 0) 1449 goto out; 1450 - if ((status = encode_remove(&xdr, args->name)) != 0) 1451 goto out; 1452 status = encode_getfattr(&xdr, args->bitmask); 1453 out: ··· 1771 struct compound_hdr hdr = { 1772 .nops = 2, 1773 }; 1774 int status; 1775 1776 xdr_init_encode(&xdr, &req->rq_snd_buf, p); ··· 1781 if(status) 1782 goto out; 1783 status = encode_readlink(&xdr, args, req); 1784 out: 1785 return status; 1786 } ··· 1803 struct compound_hdr hdr = { 1804 .nops = 2, 1805 }; 1806 int status; 1807 1808 xdr_init_encode(&xdr, &req->rq_snd_buf, p); ··· 1813 if(status) 1814 goto out; 1815 status = encode_readdir(&xdr, args, req); 1816 out: 1817 return status; 1818 } ··· 3223 uint32_t len; 3224 int status; 3225 3226 status = decode_op_hdr(xdr, OP_GETFH); 3227 if (status) 3228 return status; 3229 - /* Zero handle first to allow comparisons */ 3230 - memset(fh, 0, sizeof(*fh)); 3231 3232 READ_BUF(4); 3233 READ32(len); ··· 3835 /* 3836 * Decode REMOVE response 3837 */ 3838 - static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_remove_res *res) 3839 { 3840 struct xdr_stream xdr; 3841 struct compound_hdr hdr; ··· 3848 goto out; 3849 if ((status = decode_remove(&xdr, &res->cinfo)) != 0) 3850 goto out; 3851 - decode_getfattr(&xdr, res->dir_attr, res->server); 3852 out: 3853 return status; 3854 } ··· 4093 status = decode_open(&xdr, res); 4094 if (status) 4095 goto out; 4096 - status = decode_getfh(&xdr, &res->fh); 4097 - if (status) 4098 goto out; 4099 if (decode_getfattr(&xdr, res->f_attr, res->server) != 0) 4100 goto out; 4101 - if ((status = decode_restorefh(&xdr)) != 0) 4102 goto out; 4103 decode_getfattr(&xdr, res->dir_attr, res->server); 4104 out:
··· 72 */ 73 #define open_owner_id_maxsz (1 + 4) 74 #define lock_owner_id_maxsz (1 + 4) 75 + #define decode_lockowner_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ)) 76 #define compound_encode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 77 #define compound_decode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) 78 #define op_encode_hdr_maxsz (1) 79 #define op_decode_hdr_maxsz (2) 80 + #define encode_stateid_maxsz (XDR_QUADLEN(NFS4_STATEID_SIZE)) 81 + #define decode_stateid_maxsz (XDR_QUADLEN(NFS4_STATEID_SIZE)) 82 + #define encode_verifier_maxsz (XDR_QUADLEN(NFS4_VERIFIER_SIZE)) 83 + #define decode_verifier_maxsz (XDR_QUADLEN(NFS4_VERIFIER_SIZE)) 84 #define encode_putfh_maxsz (op_encode_hdr_maxsz + 1 + \ 85 (NFS4_FHSIZE >> 2)) 86 #define decode_putfh_maxsz (op_decode_hdr_maxsz) ··· 96 #define nfs4_fattr_maxsz (nfs4_fattr_bitmap_maxsz + \ 97 nfs4_fattr_value_maxsz) 98 #define decode_getattr_maxsz (op_decode_hdr_maxsz + nfs4_fattr_maxsz) 99 + #define encode_attrs_maxsz (nfs4_fattr_bitmap_maxsz + \ 100 + 1 + 2 + 1 + \ 101 + nfs4_owner_maxsz + \ 102 + nfs4_group_maxsz + \ 103 + 4 + 4) 104 #define encode_savefh_maxsz (op_encode_hdr_maxsz) 105 #define decode_savefh_maxsz (op_decode_hdr_maxsz) 106 #define encode_restorefh_maxsz (op_encode_hdr_maxsz) ··· 123 #define decode_lookup_maxsz (op_decode_hdr_maxsz) 124 #define encode_share_access_maxsz \ 125 (2) 126 + #define encode_createmode_maxsz (1 + encode_attrs_maxsz) 127 #define encode_opentype_maxsz (1 + encode_createmode_maxsz) 128 #define encode_claim_null_maxsz (1 + nfs4_name_maxsz) 129 #define encode_open_maxsz (op_encode_hdr_maxsz + \ ··· 132 encode_opentype_maxsz + \ 133 encode_claim_null_maxsz) 134 #define decode_ace_maxsz (3 + nfs4_owner_maxsz) 135 + #define decode_delegation_maxsz (1 + decode_stateid_maxsz + 1 + \ 136 decode_ace_maxsz) 137 #define decode_change_info_maxsz (5) 138 #define decode_open_maxsz (op_decode_hdr_maxsz + \ 139 + decode_stateid_maxsz + \ 140 decode_change_info_maxsz + 1 + \ 141 nfs4_fattr_bitmap_maxsz + \ 142 decode_delegation_maxsz) 143 + #define encode_open_confirm_maxsz \ 144 + (op_encode_hdr_maxsz + \ 145 + encode_stateid_maxsz + 1) 146 + #define decode_open_confirm_maxsz \ 147 + (op_decode_hdr_maxsz + \ 148 + decode_stateid_maxsz) 149 + #define encode_open_downgrade_maxsz \ 150 + (op_encode_hdr_maxsz + \ 151 + encode_stateid_maxsz + 1 + \ 152 + encode_share_access_maxsz) 153 + #define decode_open_downgrade_maxsz \ 154 + (op_decode_hdr_maxsz + \ 155 + decode_stateid_maxsz) 156 + #define encode_close_maxsz (op_encode_hdr_maxsz + \ 157 + 1 + encode_stateid_maxsz) 158 + #define decode_close_maxsz (op_decode_hdr_maxsz + \ 159 + decode_stateid_maxsz) 160 + #define encode_setattr_maxsz (op_encode_hdr_maxsz + \ 161 + encode_stateid_maxsz + \ 162 + encode_attrs_maxsz) 163 + #define decode_setattr_maxsz (op_decode_hdr_maxsz + \ 164 + nfs4_fattr_bitmap_maxsz) 165 + #define encode_read_maxsz (op_encode_hdr_maxsz + \ 166 + encode_stateid_maxsz + 3) 167 + #define decode_read_maxsz (op_decode_hdr_maxsz + 2) 168 + #define encode_readdir_maxsz (op_encode_hdr_maxsz + \ 169 + 2 + encode_verifier_maxsz + 5) 170 + #define decode_readdir_maxsz (op_decode_hdr_maxsz + \ 171 + decode_verifier_maxsz) 172 + #define encode_readlink_maxsz (op_encode_hdr_maxsz) 173 + #define decode_readlink_maxsz (op_decode_hdr_maxsz + 1) 174 + #define encode_write_maxsz (op_encode_hdr_maxsz + \ 175 + encode_stateid_maxsz + 4) 176 + #define decode_write_maxsz (op_decode_hdr_maxsz + \ 177 + 2 + decode_verifier_maxsz) 178 + #define encode_commit_maxsz (op_encode_hdr_maxsz + 3) 179 + #define decode_commit_maxsz (op_decode_hdr_maxsz + \ 180 + decode_verifier_maxsz) 181 #define encode_remove_maxsz (op_encode_hdr_maxsz + \ 182 nfs4_name_maxsz) 183 #define encode_rename_maxsz (op_encode_hdr_maxsz + \ ··· 148 #define encode_link_maxsz (op_encode_hdr_maxsz + \ 149 nfs4_name_maxsz) 150 #define decode_link_maxsz (op_decode_hdr_maxsz + 5) 151 + #define encode_lock_maxsz (op_encode_hdr_maxsz + \ 152 + 7 + \ 153 + 1 + encode_stateid_maxsz + 8) 154 + #define decode_lock_denied_maxsz \ 155 + (8 + decode_lockowner_maxsz) 156 + #define decode_lock_maxsz (op_decode_hdr_maxsz + \ 157 + decode_lock_denied_maxsz) 158 + #define encode_lockt_maxsz (op_encode_hdr_maxsz + 12) 159 + #define decode_lockt_maxsz (op_decode_hdr_maxsz + \ 160 + decode_lock_denied_maxsz) 161 + #define encode_locku_maxsz (op_encode_hdr_maxsz + 3 + \ 162 + encode_stateid_maxsz + \ 163 + 4) 164 + #define decode_locku_maxsz (op_decode_hdr_maxsz + \ 165 + decode_stateid_maxsz) 166 + #define encode_access_maxsz (op_encode_hdr_maxsz + 1) 167 + #define decode_access_maxsz (op_decode_hdr_maxsz + 2) 168 #define encode_symlink_maxsz (op_encode_hdr_maxsz + \ 169 1 + nfs4_name_maxsz + \ 170 1 + \ 171 nfs4_fattr_maxsz) 172 #define decode_symlink_maxsz (op_decode_hdr_maxsz + 8) 173 #define encode_create_maxsz (op_encode_hdr_maxsz + \ 174 + 1 + 2 + nfs4_name_maxsz + \ 175 + encode_attrs_maxsz) 176 #define decode_create_maxsz (op_decode_hdr_maxsz + \ 177 decode_change_info_maxsz + \ 178 nfs4_fattr_bitmap_maxsz) 179 + #define encode_statfs_maxsz (encode_getattr_maxsz) 180 + #define decode_statfs_maxsz (decode_getattr_maxsz) 181 #define encode_delegreturn_maxsz (op_encode_hdr_maxsz + 4) 182 #define decode_delegreturn_maxsz (op_decode_hdr_maxsz) 183 + #define encode_getacl_maxsz (encode_getattr_maxsz) 184 + #define decode_getacl_maxsz (op_decode_hdr_maxsz + \ 185 + nfs4_fattr_bitmap_maxsz + 1) 186 + #define encode_setacl_maxsz (op_encode_hdr_maxsz + \ 187 + encode_stateid_maxsz + 3) 188 + #define decode_setacl_maxsz (decode_setattr_maxsz) 189 #define encode_fs_locations_maxsz \ 190 (encode_getattr_maxsz) 191 #define decode_fs_locations_maxsz \ ··· 169 #define NFS4_dec_compound_sz (1024) /* XXX: large enough? */ 170 #define NFS4_enc_read_sz (compound_encode_hdr_maxsz + \ 171 encode_putfh_maxsz + \ 172 + encode_read_maxsz) 173 #define NFS4_dec_read_sz (compound_decode_hdr_maxsz + \ 174 decode_putfh_maxsz + \ 175 + decode_read_maxsz) 176 #define NFS4_enc_readlink_sz (compound_encode_hdr_maxsz + \ 177 encode_putfh_maxsz + \ 178 + encode_readlink_maxsz) 179 #define NFS4_dec_readlink_sz (compound_decode_hdr_maxsz + \ 180 decode_putfh_maxsz + \ 181 + decode_readlink_maxsz) 182 #define NFS4_enc_readdir_sz (compound_encode_hdr_maxsz + \ 183 encode_putfh_maxsz + \ 184 + encode_readdir_maxsz) 185 #define NFS4_dec_readdir_sz (compound_decode_hdr_maxsz + \ 186 decode_putfh_maxsz + \ 187 + decode_readdir_maxsz) 188 #define NFS4_enc_write_sz (compound_encode_hdr_maxsz + \ 189 encode_putfh_maxsz + \ 190 + encode_write_maxsz + \ 191 encode_getattr_maxsz) 192 #define NFS4_dec_write_sz (compound_decode_hdr_maxsz + \ 193 decode_putfh_maxsz + \ 194 + decode_write_maxsz + \ 195 decode_getattr_maxsz) 196 #define NFS4_enc_commit_sz (compound_encode_hdr_maxsz + \ 197 encode_putfh_maxsz + \ 198 + encode_commit_maxsz + \ 199 encode_getattr_maxsz) 200 #define NFS4_dec_commit_sz (compound_decode_hdr_maxsz + \ 201 decode_putfh_maxsz + \ 202 + decode_commit_maxsz + \ 203 decode_getattr_maxsz) 204 #define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \ 205 encode_putfh_maxsz + \ ··· 217 decode_getattr_maxsz + \ 218 decode_restorefh_maxsz + \ 219 decode_getattr_maxsz) 220 + #define NFS4_enc_open_confirm_sz \ 221 + (compound_encode_hdr_maxsz + \ 222 + encode_putfh_maxsz + \ 223 + encode_open_confirm_maxsz) 224 + #define NFS4_dec_open_confirm_sz \ 225 + (compound_decode_hdr_maxsz + \ 226 + decode_putfh_maxsz + \ 227 + decode_open_confirm_maxsz) 228 #define NFS4_enc_open_noattr_sz (compound_encode_hdr_maxsz + \ 229 encode_putfh_maxsz + \ 230 encode_open_maxsz + \ ··· 234 decode_getattr_maxsz) 235 #define NFS4_enc_open_downgrade_sz \ 236 (compound_encode_hdr_maxsz + \ 237 + encode_putfh_maxsz + \ 238 + encode_open_downgrade_maxsz + \ 239 + encode_getattr_maxsz) 240 #define NFS4_dec_open_downgrade_sz \ 241 (compound_decode_hdr_maxsz + \ 242 + decode_putfh_maxsz + \ 243 + decode_open_downgrade_maxsz + \ 244 + decode_getattr_maxsz) 245 + #define NFS4_enc_close_sz (compound_encode_hdr_maxsz + \ 246 + encode_putfh_maxsz + \ 247 + encode_close_maxsz + \ 248 + encode_getattr_maxsz) 249 + #define NFS4_dec_close_sz (compound_decode_hdr_maxsz + \ 250 + decode_putfh_maxsz + \ 251 + decode_close_maxsz + \ 252 + decode_getattr_maxsz) 253 + #define NFS4_enc_setattr_sz (compound_encode_hdr_maxsz + \ 254 + encode_putfh_maxsz + \ 255 + encode_setattr_maxsz + \ 256 + encode_getattr_maxsz) 257 + #define NFS4_dec_setattr_sz (compound_decode_hdr_maxsz + \ 258 + decode_putfh_maxsz + \ 259 + decode_setattr_maxsz + \ 260 + decode_getattr_maxsz) 261 #define NFS4_enc_fsinfo_sz (compound_encode_hdr_maxsz + \ 262 encode_putfh_maxsz + \ 263 encode_fsinfo_maxsz) ··· 285 decode_fsinfo_maxsz) 286 #define NFS4_enc_lock_sz (compound_encode_hdr_maxsz + \ 287 encode_putfh_maxsz + \ 288 + encode_lock_maxsz) 289 #define NFS4_dec_lock_sz (compound_decode_hdr_maxsz + \ 290 decode_putfh_maxsz + \ 291 + decode_lock_maxsz) 292 #define NFS4_enc_lockt_sz (compound_encode_hdr_maxsz + \ 293 encode_putfh_maxsz + \ 294 + encode_lockt_maxsz) 295 + #define NFS4_dec_lockt_sz (compound_decode_hdr_maxsz + \ 296 + decode_putfh_maxsz + \ 297 + decode_lockt_maxsz) 298 #define NFS4_enc_locku_sz (compound_encode_hdr_maxsz + \ 299 encode_putfh_maxsz + \ 300 + encode_locku_maxsz) 301 #define NFS4_dec_locku_sz (compound_decode_hdr_maxsz + \ 302 decode_putfh_maxsz + \ 303 + decode_locku_maxsz) 304 #define NFS4_enc_access_sz (compound_encode_hdr_maxsz + \ 305 encode_putfh_maxsz + \ 306 + encode_access_maxsz) 307 #define NFS4_dec_access_sz (compound_decode_hdr_maxsz + \ 308 decode_putfh_maxsz + \ 309 + decode_access_maxsz) 310 #define NFS4_enc_getattr_sz (compound_encode_hdr_maxsz + \ 311 encode_putfh_maxsz + \ 312 encode_getattr_maxsz) ··· 416 decode_getattr_maxsz) 417 #define NFS4_enc_statfs_sz (compound_encode_hdr_maxsz + \ 418 encode_putfh_maxsz + \ 419 + encode_statfs_maxsz) 420 #define NFS4_dec_statfs_sz (compound_decode_hdr_maxsz + \ 421 decode_putfh_maxsz + \ 422 + decode_statfs_maxsz) 423 #define NFS4_enc_server_caps_sz (compound_encode_hdr_maxsz + \ 424 encode_putfh_maxsz + \ 425 encode_getattr_maxsz) ··· 435 decode_getattr_maxsz) 436 #define NFS4_enc_getacl_sz (compound_encode_hdr_maxsz + \ 437 encode_putfh_maxsz + \ 438 + encode_getacl_maxsz) 439 #define NFS4_dec_getacl_sz (compound_decode_hdr_maxsz + \ 440 decode_putfh_maxsz + \ 441 + decode_getacl_maxsz) 442 #define NFS4_enc_setacl_sz (compound_encode_hdr_maxsz + \ 443 encode_putfh_maxsz + \ 444 + encode_setacl_maxsz) 445 #define NFS4_dec_setacl_sz (compound_decode_hdr_maxsz + \ 446 decode_putfh_maxsz + \ 447 + decode_setacl_maxsz) 448 #define NFS4_enc_fs_locations_sz \ 449 (compound_encode_hdr_maxsz + \ 450 encode_putfh_maxsz + \ ··· 1108 1109 static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req) 1110 { 1111 uint32_t attrs[2] = { 1112 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, 1113 FATTR4_WORD1_MOUNTED_ON_FILEID, 1114 }; 1115 __be32 *p; 1116 1117 RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20); ··· 1138 attrs[0] & readdir->bitmask[0], 1139 attrs[1] & readdir->bitmask[1]); 1140 1141 return 0; 1142 } 1143 1144 static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req) 1145 { 1146 __be32 *p; 1147 1148 RESERVE_SPACE(4); 1149 WRITE32(OP_READLINK); 1150 1151 return 0; 1152 } 1153 ··· 1398 /* 1399 * Encode REMOVE request 1400 */ 1401 + static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs_removeargs *args) 1402 { 1403 struct xdr_stream xdr; 1404 struct compound_hdr hdr = { ··· 1410 encode_compound_hdr(&xdr, &hdr); 1411 if ((status = encode_putfh(&xdr, args->fh)) != 0) 1412 goto out; 1413 + if ((status = encode_remove(&xdr, &args->name)) != 0) 1414 goto out; 1415 status = encode_getfattr(&xdr, args->bitmask); 1416 out: ··· 1734 struct compound_hdr hdr = { 1735 .nops = 2, 1736 }; 1737 + struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1738 + unsigned int replen; 1739 int status; 1740 1741 xdr_init_encode(&xdr, &req->rq_snd_buf, p); ··· 1742 if(status) 1743 goto out; 1744 status = encode_readlink(&xdr, args, req); 1745 + 1746 + /* set up reply kvec 1747 + * toplevel_status + taglen + rescount + OP_PUTFH + status 1748 + * + OP_READLINK + status + string length = 8 1749 + */ 1750 + replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_readlink_sz) << 2; 1751 + xdr_inline_pages(&req->rq_rcv_buf, replen, args->pages, 1752 + args->pgbase, args->pglen); 1753 + 1754 out: 1755 return status; 1756 } ··· 1755 struct compound_hdr hdr = { 1756 .nops = 2, 1757 }; 1758 + struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; 1759 + int replen; 1760 int status; 1761 1762 xdr_init_encode(&xdr, &req->rq_snd_buf, p); ··· 1763 if(status) 1764 goto out; 1765 status = encode_readdir(&xdr, args, req); 1766 + 1767 + /* set up reply kvec 1768 + * toplevel_status + taglen + rescount + OP_PUTFH + status 1769 + * + OP_READDIR + status + verifer(2) = 9 1770 + */ 1771 + replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_readdir_sz) << 2; 1772 + xdr_inline_pages(&req->rq_rcv_buf, replen, args->pages, 1773 + args->pgbase, args->count); 1774 + dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", 1775 + __FUNCTION__, replen, args->pages, 1776 + args->pgbase, args->count); 1777 + 1778 out: 1779 return status; 1780 } ··· 3161 uint32_t len; 3162 int status; 3163 3164 + /* Zero handle first to allow comparisons */ 3165 + memset(fh, 0, sizeof(*fh)); 3166 + 3167 status = decode_op_hdr(xdr, OP_GETFH); 3168 if (status) 3169 return status; 3170 3171 READ_BUF(4); 3172 READ32(len); ··· 3772 /* 3773 * Decode REMOVE response 3774 */ 3775 + static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs_removeres *res) 3776 { 3777 struct xdr_stream xdr; 3778 struct compound_hdr hdr; ··· 3785 goto out; 3786 if ((status = decode_remove(&xdr, &res->cinfo)) != 0) 3787 goto out; 3788 + decode_getfattr(&xdr, &res->dir_attr, res->server); 3789 out: 3790 return status; 3791 } ··· 4030 status = decode_open(&xdr, res); 4031 if (status) 4032 goto out; 4033 + if (decode_getfh(&xdr, &res->fh) != 0) 4034 goto out; 4035 if (decode_getfattr(&xdr, res->f_attr, res->server) != 0) 4036 goto out; 4037 + if (decode_restorefh(&xdr) != 0) 4038 goto out; 4039 decode_getfattr(&xdr, res->dir_attr, res->server); 4040 out:
+12 -28
fs/nfs/proc.c
··· 272 static int 273 nfs_proc_remove(struct inode *dir, struct qstr *name) 274 { 275 - struct nfs_diropargs arg = { 276 - .fh = NFS_FH(dir), 277 - .name = name->name, 278 - .len = name->len 279 }; 280 - struct rpc_message msg = { 281 - .rpc_proc = &nfs_procedures[NFSPROC_REMOVE], 282 - .rpc_argp = &arg, 283 }; 284 int status; 285 ··· 291 return status; 292 } 293 294 - static int 295 - nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name) 296 { 297 - struct nfs_diropargs *arg; 298 - 299 - arg = kmalloc(sizeof(*arg), GFP_KERNEL); 300 - if (!arg) 301 - return -ENOMEM; 302 - arg->fh = NFS_FH(dir->d_inode); 303 - arg->name = name->name; 304 - arg->len = name->len; 305 msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; 306 - msg->rpc_argp = arg; 307 - return 0; 308 } 309 310 - static int 311 - nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task) 312 { 313 - struct rpc_message *msg = &task->tk_msg; 314 - 315 - if (msg->rpc_argp) { 316 - nfs_mark_for_revalidate(dir->d_inode); 317 - kfree(msg->rpc_argp); 318 - } 319 - return 0; 320 } 321 322 static int
··· 272 static int 273 nfs_proc_remove(struct inode *dir, struct qstr *name) 274 { 275 + struct nfs_removeargs arg = { 276 + .fh = NFS_FH(dir), 277 + .name.len = name->len, 278 + .name.name = name->name, 279 }; 280 + struct rpc_message msg = { 281 + .rpc_proc = &nfs_procedures[NFSPROC_REMOVE], 282 + .rpc_argp = &arg, 283 }; 284 int status; 285 ··· 291 return status; 292 } 293 294 + static void 295 + nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) 296 { 297 msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; 298 } 299 300 + static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir) 301 { 302 + nfs_mark_for_revalidate(dir); 303 + return 1; 304 } 305 306 static int
+7
fs/nfs/super.c
··· 1685 1686 dprintk("MNTPATH: %s\n", *mntpath); 1687 1688 *ip_addr = args.client_address; 1689 1690 break; ··· 1707 1708 out_no_address: 1709 dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n"); 1710 return -EINVAL; 1711 } 1712
··· 1685 1686 dprintk("MNTPATH: %s\n", *mntpath); 1687 1688 + if (args.client_address == NULL) 1689 + goto out_no_client_address; 1690 + 1691 *ip_addr = args.client_address; 1692 1693 break; ··· 1704 1705 out_no_address: 1706 dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n"); 1707 + return -EINVAL; 1708 + 1709 + out_no_client_address: 1710 + dfprintk(MOUNT, "NFS4: mount program didn't pass callback address\n"); 1711 return -EINVAL; 1712 } 1713
+85 -108
fs/nfs/unlink.c
··· 3 * 4 * nfs sillydelete handling 5 * 6 - * NOTE: we rely on holding the BKL for list manipulation protection. 7 */ 8 9 #include <linux/slab.h> ··· 14 15 16 struct nfs_unlinkdata { 17 - struct nfs_unlinkdata *next; 18 - struct dentry *dir, *dentry; 19 - struct qstr name; 20 - struct rpc_task task; 21 struct rpc_cred *cred; 22 - unsigned int count; 23 }; 24 25 - static struct nfs_unlinkdata *nfs_deletes; 26 - static RPC_WAITQ(nfs_delete_queue, "nfs_delete_queue"); 27 - 28 /** 29 - * nfs_detach_unlinkdata - Remove asynchronous unlink from global list 30 - * @data: pointer to descriptor 31 - */ 32 - static inline void 33 - nfs_detach_unlinkdata(struct nfs_unlinkdata *data) 34 - { 35 - struct nfs_unlinkdata **q; 36 - 37 - for (q = &nfs_deletes; *q != NULL; q = &((*q)->next)) { 38 - if (*q == data) { 39 - *q = data->next; 40 - break; 41 - } 42 - } 43 - } 44 - 45 - /** 46 - * nfs_put_unlinkdata - release data from a sillydelete operation. 47 * @data: pointer to unlink structure. 48 */ 49 static void 50 - nfs_put_unlinkdata(struct nfs_unlinkdata *data) 51 { 52 - if (--data->count == 0) { 53 - nfs_detach_unlinkdata(data); 54 - kfree(data->name.name); 55 - kfree(data); 56 - } 57 } 58 59 #define NAME_ALLOC_LEN(len) ((len+16) & ~15) ··· 39 * @dentry: pointer to dentry 40 * @data: nfs_unlinkdata 41 */ 42 - static inline void 43 - nfs_copy_dname(struct dentry *dentry, struct nfs_unlinkdata *data) 44 { 45 char *str; 46 int len = dentry->d_name.len; 47 48 - str = kmalloc(NAME_ALLOC_LEN(len), GFP_KERNEL); 49 if (!str) 50 - return; 51 - memcpy(str, dentry->d_name.name, len); 52 - if (!data->name.len) { 53 - data->name.len = len; 54 - data->name.name = str; 55 - } else 56 - kfree(str); 57 } 58 59 /** 60 * nfs_async_unlink_init - Initialize the RPC info 61 - * @task: rpc_task of the sillydelete 62 - * 63 - * We delay initializing RPC info until after the call to dentry_iput() 64 - * in order to minimize races against rename(). 65 */ 66 static void nfs_async_unlink_init(struct rpc_task *task, void *calldata) 67 { 68 - struct nfs_unlinkdata *data = calldata; 69 - struct dentry *dir = data->dir; 70 - struct rpc_message msg = { 71 - .rpc_cred = data->cred, 72 }; 73 - int status = -ENOENT; 74 75 - if (!data->name.len) 76 - goto out_err; 77 - 78 - status = NFS_PROTO(dir->d_inode)->unlink_setup(&msg, dir, &data->name); 79 - if (status < 0) 80 - goto out_err; 81 - nfs_begin_data_update(dir->d_inode); 82 rpc_call_setup(task, &msg, 0); 83 - return; 84 - out_err: 85 - rpc_exit(task, status); 86 } 87 88 /** ··· 79 */ 80 static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) 81 { 82 - struct nfs_unlinkdata *data = calldata; 83 - struct dentry *dir = data->dir; 84 - struct inode *dir_i; 85 86 - if (!dir) 87 - return; 88 - dir_i = dir->d_inode; 89 - nfs_end_data_update(dir_i); 90 - if (NFS_PROTO(dir_i)->unlink_done(dir, task)) 91 - return; 92 - put_rpccred(data->cred); 93 - data->cred = NULL; 94 - dput(dir); 95 } 96 97 /** ··· 98 static void nfs_async_unlink_release(void *calldata) 99 { 100 struct nfs_unlinkdata *data = calldata; 101 - nfs_put_unlinkdata(data); 102 } 103 104 static const struct rpc_call_ops nfs_unlink_ops = { ··· 107 .rpc_release = nfs_async_unlink_release, 108 }; 109 110 /** 111 * nfs_async_unlink - asynchronous unlinking of a file 112 * @dentry: dentry to unlink 113 */ 114 int 115 - nfs_async_unlink(struct dentry *dentry) 116 { 117 - struct dentry *dir = dentry->d_parent; 118 - struct nfs_unlinkdata *data; 119 - struct rpc_clnt *clnt = NFS_CLIENT(dir->d_inode); 120 - int status = -ENOMEM; 121 122 data = kzalloc(sizeof(*data), GFP_KERNEL); 123 - if (!data) 124 goto out; 125 126 - data->cred = rpcauth_lookupcred(clnt->cl_auth, 0); 127 if (IS_ERR(data->cred)) { 128 status = PTR_ERR(data->cred); 129 goto out_free; 130 } 131 - data->dir = dget(dir); 132 - data->dentry = dentry; 133 134 - data->next = nfs_deletes; 135 - nfs_deletes = data; 136 - data->count = 1; 137 - 138 - rpc_init_task(&data->task, clnt, RPC_TASK_ASYNC, &nfs_unlink_ops, data); 139 - 140 spin_lock(&dentry->d_lock); 141 dentry->d_flags |= DCACHE_NFSFS_RENAMED; 142 spin_unlock(&dentry->d_lock); 143 - 144 - rpc_sleep_on(&nfs_delete_queue, &data->task, NULL, NULL); 145 - status = 0; 146 - out: 147 - return status; 148 out_free: 149 kfree(data); 150 return status; 151 } 152 153 /** 154 * nfs_complete_unlink - Initialize completion of the sillydelete 155 * @dentry: dentry to delete 156 * 157 * Since we're most likely to be called by dentry_iput(), we 158 * only use the dentry to find the sillydelete. We then copy the name 159 * into the qstr. 160 */ 161 void 162 - nfs_complete_unlink(struct dentry *dentry) 163 { 164 - struct nfs_unlinkdata *data; 165 166 - for(data = nfs_deletes; data != NULL; data = data->next) { 167 - if (dentry == data->dentry) 168 - break; 169 - } 170 - if (!data) 171 - return; 172 - data->count++; 173 - nfs_copy_dname(dentry, data); 174 spin_lock(&dentry->d_lock); 175 - dentry->d_flags &= ~DCACHE_NFSFS_RENAMED; 176 spin_unlock(&dentry->d_lock); 177 - rpc_wake_up_task(&data->task); 178 - nfs_put_unlinkdata(data); 179 }
··· 3 * 4 * nfs sillydelete handling 5 * 6 */ 7 8 #include <linux/slab.h> ··· 15 16 17 struct nfs_unlinkdata { 18 + struct nfs_removeargs args; 19 + struct nfs_removeres res; 20 + struct inode *dir; 21 struct rpc_cred *cred; 22 }; 23 24 /** 25 + * nfs_free_unlinkdata - release data from a sillydelete operation. 26 * @data: pointer to unlink structure. 27 */ 28 static void 29 + nfs_free_unlinkdata(struct nfs_unlinkdata *data) 30 { 31 + iput(data->dir); 32 + put_rpccred(data->cred); 33 + kfree(data->args.name.name); 34 + kfree(data); 35 } 36 37 #define NAME_ALLOC_LEN(len) ((len+16) & ~15) ··· 63 * @dentry: pointer to dentry 64 * @data: nfs_unlinkdata 65 */ 66 + static int nfs_copy_dname(struct dentry *dentry, struct nfs_unlinkdata *data) 67 { 68 char *str; 69 int len = dentry->d_name.len; 70 71 + str = kmemdup(dentry->d_name.name, NAME_ALLOC_LEN(len), GFP_KERNEL); 72 if (!str) 73 + return -ENOMEM; 74 + data->args.name.len = len; 75 + data->args.name.name = str; 76 + return 0; 77 } 78 79 /** 80 * nfs_async_unlink_init - Initialize the RPC info 81 + * task: rpc_task of the sillydelete 82 */ 83 static void nfs_async_unlink_init(struct rpc_task *task, void *calldata) 84 { 85 + struct nfs_unlinkdata *data = calldata; 86 + struct inode *dir = data->dir; 87 + struct rpc_message msg = { 88 + .rpc_argp = &data->args, 89 + .rpc_resp = &data->res, 90 + .rpc_cred = data->cred, 91 }; 92 93 + nfs_begin_data_update(dir); 94 + NFS_PROTO(dir)->unlink_setup(&msg, dir); 95 rpc_call_setup(task, &msg, 0); 96 } 97 98 /** ··· 117 */ 118 static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) 119 { 120 + struct nfs_unlinkdata *data = calldata; 121 + struct inode *dir = data->dir; 122 123 + if (!NFS_PROTO(dir)->unlink_done(task, dir)) 124 + rpc_restart_call(task); 125 + else 126 + nfs_end_data_update(dir); 127 } 128 129 /** ··· 142 static void nfs_async_unlink_release(void *calldata) 143 { 144 struct nfs_unlinkdata *data = calldata; 145 + nfs_free_unlinkdata(data); 146 } 147 148 static const struct rpc_call_ops nfs_unlink_ops = { ··· 151 .rpc_release = nfs_async_unlink_release, 152 }; 153 154 + static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) 155 + { 156 + struct rpc_task *task; 157 + struct dentry *parent; 158 + struct inode *dir; 159 + 160 + if (nfs_copy_dname(dentry, data) < 0) 161 + goto out_free; 162 + 163 + parent = dget_parent(dentry); 164 + if (parent == NULL) 165 + goto out_free; 166 + dir = igrab(parent->d_inode); 167 + dput(parent); 168 + if (dir == NULL) 169 + goto out_free; 170 + 171 + data->dir = dir; 172 + data->args.fh = NFS_FH(dir); 173 + nfs_fattr_init(&data->res.dir_attr); 174 + 175 + task = rpc_run_task(NFS_CLIENT(dir), RPC_TASK_ASYNC, &nfs_unlink_ops, data); 176 + if (!IS_ERR(task)) 177 + rpc_put_task(task); 178 + return 1; 179 + out_free: 180 + return 0; 181 + } 182 + 183 /** 184 * nfs_async_unlink - asynchronous unlinking of a file 185 + * @dir: parent directory of dentry 186 * @dentry: dentry to unlink 187 */ 188 int 189 + nfs_async_unlink(struct inode *dir, struct dentry *dentry) 190 { 191 + struct nfs_unlinkdata *data; 192 + int status = -ENOMEM; 193 194 data = kzalloc(sizeof(*data), GFP_KERNEL); 195 + if (data == NULL) 196 goto out; 197 198 + data->cred = rpcauth_lookupcred(NFS_CLIENT(dir)->cl_auth, 0); 199 if (IS_ERR(data->cred)) { 200 status = PTR_ERR(data->cred); 201 goto out_free; 202 } 203 204 + status = -EBUSY; 205 spin_lock(&dentry->d_lock); 206 + if (dentry->d_flags & DCACHE_NFSFS_RENAMED) 207 + goto out_unlock; 208 dentry->d_flags |= DCACHE_NFSFS_RENAMED; 209 + dentry->d_fsdata = data; 210 spin_unlock(&dentry->d_lock); 211 + return 0; 212 + out_unlock: 213 + spin_unlock(&dentry->d_lock); 214 + put_rpccred(data->cred); 215 out_free: 216 kfree(data); 217 + out: 218 return status; 219 } 220 221 /** 222 * nfs_complete_unlink - Initialize completion of the sillydelete 223 * @dentry: dentry to delete 224 + * @inode: inode 225 * 226 * Since we're most likely to be called by dentry_iput(), we 227 * only use the dentry to find the sillydelete. We then copy the name 228 * into the qstr. 229 */ 230 void 231 + nfs_complete_unlink(struct dentry *dentry, struct inode *inode) 232 { 233 + struct nfs_unlinkdata *data = NULL; 234 235 spin_lock(&dentry->d_lock); 236 + if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 237 + dentry->d_flags &= ~DCACHE_NFSFS_RENAMED; 238 + data = dentry->d_fsdata; 239 + } 240 spin_unlock(&dentry->d_lock); 241 + 242 + if (data != NULL && (NFS_STALE(inode) || !nfs_call_unlink(dentry, data))) 243 + nfs_free_unlinkdata(data); 244 }
+2 -2
include/linux/nfs_fs.h
··· 407 /* 408 * linux/fs/nfs/unlink.c 409 */ 410 - extern int nfs_async_unlink(struct dentry *); 411 - extern void nfs_complete_unlink(struct dentry *); 412 413 /* 414 * linux/fs/nfs/write.c
··· 407 /* 408 * linux/fs/nfs/unlink.c 409 */ 410 + extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); 411 + extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 412 413 /* 414 * linux/fs/nfs/write.c
+17 -15
include/linux/nfs_xdr.h
··· 278 }; 279 280 /* 281 * Argument struct for decode_entry function 282 */ 283 struct nfs_entry { ··· 646 struct page ** pages; /* zero-copy data */ 647 }; 648 649 - struct nfs4_remove_arg { 650 - const struct nfs_fh * fh; 651 - const struct qstr * name; 652 - const u32 * bitmask; 653 - }; 654 - 655 - struct nfs4_remove_res { 656 - const struct nfs_server * server; 657 - struct nfs4_change_info cinfo; 658 - struct nfs_fattr * dir_attr; 659 - }; 660 - 661 struct nfs4_rename_arg { 662 const struct nfs_fh * old_dir; 663 const struct nfs_fh * new_dir; ··· 791 int (*create) (struct inode *, struct dentry *, 792 struct iattr *, int, struct nameidata *); 793 int (*remove) (struct inode *, struct qstr *); 794 - int (*unlink_setup) (struct rpc_message *, 795 - struct dentry *, struct qstr *); 796 - int (*unlink_done) (struct dentry *, struct rpc_task *); 797 int (*rename) (struct inode *, struct qstr *, 798 struct inode *, struct qstr *); 799 int (*link) (struct inode *, struct inode *, struct qstr *);
··· 278 }; 279 280 /* 281 + * Common arguments to the unlink call 282 + */ 283 + struct nfs_removeargs { 284 + const struct nfs_fh *fh; 285 + struct qstr name; 286 + const u32 * bitmask; 287 + }; 288 + 289 + struct nfs_removeres { 290 + const struct nfs_server *server; 291 + struct nfs4_change_info cinfo; 292 + struct nfs_fattr dir_attr; 293 + }; 294 + 295 + /* 296 * Argument struct for decode_entry function 297 */ 298 struct nfs_entry { ··· 631 struct page ** pages; /* zero-copy data */ 632 }; 633 634 struct nfs4_rename_arg { 635 const struct nfs_fh * old_dir; 636 const struct nfs_fh * new_dir; ··· 788 int (*create) (struct inode *, struct dentry *, 789 struct iattr *, int, struct nameidata *); 790 int (*remove) (struct inode *, struct qstr *); 791 + void (*unlink_setup) (struct rpc_message *, struct inode *dir); 792 + int (*unlink_done) (struct rpc_task *, struct inode *); 793 int (*rename) (struct inode *, struct qstr *, 794 struct inode *, struct qstr *); 795 int (*link) (struct inode *, struct inode *, struct qstr *);
+16
include/linux/sunrpc/xdr.h
··· 12 #include <linux/uio.h> 13 #include <asm/byteorder.h> 14 #include <linux/scatterlist.h> 15 16 /* 17 * Buffer adjustment ··· 35 * Encode functions always assume there's enough room in the buffer. 36 */ 37 typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 38 39 /* 40 * Basic structure for transmission/reception of a client XDR message.
··· 12 #include <linux/uio.h> 13 #include <asm/byteorder.h> 14 #include <linux/scatterlist.h> 15 + #include <linux/smp_lock.h> 16 17 /* 18 * Buffer adjustment ··· 34 * Encode functions always assume there's enough room in the buffer. 35 */ 36 typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 37 + 38 + /* 39 + * We're still requiring the BKL in the xdr code until it's been 40 + * more carefully audited, at which point this wrapper will become 41 + * unnecessary. 42 + */ 43 + static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj) 44 + { 45 + int ret; 46 + 47 + lock_kernel(); 48 + ret = xdrproc(rqstp, data, obj); 49 + unlock_kernel(); 50 + return ret; 51 + } 52 53 /* 54 * Basic structure for transmission/reception of a client XDR message.
+2 -11
net/sunrpc/auth.c
··· 13 #include <linux/errno.h> 14 #include <linux/sunrpc/clnt.h> 15 #include <linux/spinlock.h> 16 - #include <linux/smp_lock.h> 17 18 #ifdef RPC_DEBUG 19 # define RPCDBG_FACILITY RPCDBG_AUTH ··· 475 __be32 *data, void *obj) 476 { 477 struct rpc_cred *cred = task->tk_msg.rpc_cred; 478 - int ret; 479 480 dprintk("RPC: %5u using %s cred %p to wrap rpc data\n", 481 task->tk_pid, cred->cr_ops->cr_name, cred); 482 if (cred->cr_ops->crwrap_req) 483 return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj); 484 /* By default, we encode the arguments normally. */ 485 - lock_kernel(); 486 - ret = encode(rqstp, data, obj); 487 - unlock_kernel(); 488 - return ret; 489 } 490 491 int ··· 489 __be32 *data, void *obj) 490 { 491 struct rpc_cred *cred = task->tk_msg.rpc_cred; 492 - int ret; 493 494 dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n", 495 task->tk_pid, cred->cr_ops->cr_name, cred); ··· 496 return cred->cr_ops->crunwrap_resp(task, decode, rqstp, 497 data, obj); 498 /* By default, we decode the arguments normally. */ 499 - lock_kernel(); 500 - ret = decode(rqstp, data, obj); 501 - unlock_kernel(); 502 - return ret; 503 } 504 505 int
··· 13 #include <linux/errno.h> 14 #include <linux/sunrpc/clnt.h> 15 #include <linux/spinlock.h> 16 17 #ifdef RPC_DEBUG 18 # define RPCDBG_FACILITY RPCDBG_AUTH ··· 476 __be32 *data, void *obj) 477 { 478 struct rpc_cred *cred = task->tk_msg.rpc_cred; 479 480 dprintk("RPC: %5u using %s cred %p to wrap rpc data\n", 481 task->tk_pid, cred->cr_ops->cr_name, cred); 482 if (cred->cr_ops->crwrap_req) 483 return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj); 484 /* By default, we encode the arguments normally. */ 485 + return rpc_call_xdrproc(encode, rqstp, data, obj); 486 } 487 488 int ··· 494 __be32 *data, void *obj) 495 { 496 struct rpc_cred *cred = task->tk_msg.rpc_cred; 497 498 dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n", 499 task->tk_pid, cred->cr_ops->cr_name, cred); ··· 502 return cred->cr_ops->crunwrap_resp(task, decode, rqstp, 503 data, obj); 504 /* By default, we decode the arguments normally. */ 505 + return rpc_call_xdrproc(decode, rqstp, data, obj); 506 } 507 508 int
+5 -16
net/sunrpc/auth_gss/auth_gss.c
··· 43 #include <linux/types.h> 44 #include <linux/slab.h> 45 #include <linux/sched.h> 46 - #include <linux/smp_lock.h> 47 #include <linux/pagemap.h> 48 #include <linux/sunrpc/clnt.h> 49 #include <linux/sunrpc/auth.h> ··· 999 offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base; 1000 *p++ = htonl(rqstp->rq_seqno); 1001 1002 - lock_kernel(); 1003 - status = encode(rqstp, p, obj); 1004 - unlock_kernel(); 1005 if (status) 1006 return status; 1007 ··· 1093 offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base; 1094 *p++ = htonl(rqstp->rq_seqno); 1095 1096 - lock_kernel(); 1097 - status = encode(rqstp, p, obj); 1098 - unlock_kernel(); 1099 if (status) 1100 return status; 1101 ··· 1152 /* The spec seems a little ambiguous here, but I think that not 1153 * wrapping context destruction requests makes the most sense. 1154 */ 1155 - lock_kernel(); 1156 - status = encode(rqstp, p, obj); 1157 - unlock_kernel(); 1158 goto out; 1159 } 1160 switch (gss_cred->gc_service) { 1161 case RPC_GSS_SVC_NONE: 1162 - lock_kernel(); 1163 - status = encode(rqstp, p, obj); 1164 - unlock_kernel(); 1165 break; 1166 case RPC_GSS_SVC_INTEGRITY: 1167 status = gss_wrap_req_integ(cred, ctx, encode, ··· 1273 cred->cr_auth->au_rslack = cred->cr_auth->au_verfsize + (p - savedp) 1274 + (savedlen - head->iov_len); 1275 out_decode: 1276 - lock_kernel(); 1277 - status = decode(rqstp, p, obj); 1278 - unlock_kernel(); 1279 out: 1280 gss_put_ctx(ctx); 1281 dprintk("RPC: %5u gss_unwrap_resp returning %d\n", task->tk_pid,
··· 43 #include <linux/types.h> 44 #include <linux/slab.h> 45 #include <linux/sched.h> 46 #include <linux/pagemap.h> 47 #include <linux/sunrpc/clnt.h> 48 #include <linux/sunrpc/auth.h> ··· 1000 offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base; 1001 *p++ = htonl(rqstp->rq_seqno); 1002 1003 + status = rpc_call_xdrproc(encode, rqstp, p, obj); 1004 if (status) 1005 return status; 1006 ··· 1096 offset = (u8 *)p - (u8 *)snd_buf->head[0].iov_base; 1097 *p++ = htonl(rqstp->rq_seqno); 1098 1099 + status = rpc_call_xdrproc(encode, rqstp, p, obj); 1100 if (status) 1101 return status; 1102 ··· 1157 /* The spec seems a little ambiguous here, but I think that not 1158 * wrapping context destruction requests makes the most sense. 1159 */ 1160 + status = rpc_call_xdrproc(encode, rqstp, p, obj); 1161 goto out; 1162 } 1163 switch (gss_cred->gc_service) { 1164 case RPC_GSS_SVC_NONE: 1165 + status = rpc_call_xdrproc(encode, rqstp, p, obj); 1166 break; 1167 case RPC_GSS_SVC_INTEGRITY: 1168 status = gss_wrap_req_integ(cred, ctx, encode, ··· 1282 cred->cr_auth->au_rslack = cred->cr_auth->au_verfsize + (p - savedp) 1283 + (savedlen - head->iov_len); 1284 out_decode: 1285 + status = rpc_call_xdrproc(decode, rqstp, p, obj); 1286 out: 1287 gss_put_ctx(ctx); 1288 dprintk("RPC: %5u gss_unwrap_resp returning %d\n", task->tk_pid,