···366366 switch (open->op_claim_type) {367367 case NFS4_OPEN_CLAIM_DELEGATE_CUR:368368 case NFS4_OPEN_CLAIM_NULL:369369- /*370370- * (1) set CURRENT_FH to the file being opened,371371- * creating it if necessary, (2) set open->op_cinfo,372372- * (3) set open->op_truncate if the file is to be373373- * truncated after opening, (4) do permission checking.374374- */375369 status = do_open_lookup(rqstp, &cstate->current_fh,376370 open);377371 if (status)···373379 break;374380 case NFS4_OPEN_CLAIM_PREVIOUS:375381 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;376376- /*377377- * The CURRENT_FH is already set to the file being378378- * opened. (1) set open->op_cinfo, (2) set379379- * open->op_truncate if the file is to be truncated380380- * after opening, (3) do permission checking.381381- */382382+ case NFS4_OPEN_CLAIM_FH:383383+ case NFS4_OPEN_CLAIM_DELEG_CUR_FH:382384 status = do_open_fhandle(rqstp, &cstate->current_fh,383385 open);384386 if (status)385387 goto out;386388 break;389389+ case NFS4_OPEN_CLAIM_DELEG_PREV_FH:387390 case NFS4_OPEN_CLAIM_DELEGATE_PREV:388391 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;389392 dprintk("NFSD: unsupported OPEN claim type %d\n",
+8-2
fs/nfsd/nfs4state.c
···25872587 return delegstateid(ret);25882588}2589258925902590+static bool nfsd4_is_deleg_cur(struct nfsd4_open *open)25912591+{25922592+ return open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR ||25932593+ open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH;25942594+}25952595+25902596static __be3225912597nfs4_check_deleg(struct nfs4_client *cl, struct nfs4_file *fp, struct nfsd4_open *open,25922598 struct nfs4_delegation **dp)···26082602 if (status)26092603 *dp = NULL;26102604out:26112611- if (open->op_claim_type != NFS4_OPEN_CLAIM_DELEGATE_CUR)26052605+ if (!nfsd4_is_deleg_cur(open))26122606 return nfs_ok;26132607 if (status)26142608 return status;···28852879 goto out;28862880 } else {28872881 status = nfserr_bad_stateid;28882888- if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR)28822882+ if (nfsd4_is_deleg_cur(open))28892883 goto out;28902884 status = nfserr_jukebox;28912885 fp = open->op_file;
+13
fs/nfsd/nfs4xdr.c
···803803 if ((status = check_filename(open->op_fname.data, open->op_fname.len, nfserr_inval)))804804 return status;805805 break;806806+ case NFS4_OPEN_CLAIM_FH:807807+ case NFS4_OPEN_CLAIM_DELEG_PREV_FH:808808+ if (argp->minorversion < 1)809809+ goto xdr_error;810810+ /* void */811811+ break;812812+ case NFS4_OPEN_CLAIM_DELEG_CUR_FH:813813+ if (argp->minorversion < 1)814814+ goto xdr_error;815815+ status = nfsd4_decode_stateid(argp, &open->op_delegate_stateid);816816+ if (status)817817+ return status;818818+ break;806819 default:807820 goto xdr_error;808821 }