 if (nfs4_in_grace() && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) return nfserr_grace;  if (!nfs4_in_grace() && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) return nfserr_no_grace; 
nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open){	int status;	dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n",		(int)open->op_fname.len, open->op_fname.data,		open->op_stateowner);	if (nfs4_in_grace() && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS)		return nfserr_grace;	if (!nfs4_in_grace() && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS)		return nfserr_no_grace;	/* This check required by spec. */	if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL)		return nfserr_inval;	nfs4_lock_state();	/* check seqid for replay. set nfs4_owner */	status = nfsd4_process_open1(open);	if (status == NFSERR_REPLAY_ME) {		struct nfs4_replay *rp = &open->op_stateowner->so_replay;		fh_put(current_fh);		current_fh->fh_handle.fh_size = rp->rp_openfh_len;		memcpy(&current_fh->fh_handle.fh_base, rp->rp_openfh,				rp->rp_openfh_len);		status = fh_verify(rqstp, current_fh, 0, MAY_NOP);		if (status)			dprintk("nfsd4_open: replay failed"				" restoring previous filehandle\n");		else			status = NFSERR_REPLAY_ME;	}	if (status)		goto out;	switch (open->op_claim_type) {		case NFS4_OPEN_CLAIM_DELEGATE_CUR:			status = nfserr_inval;			if (open->op_create)				goto out;			/* fall through */		case NFS4_OPEN_CLAIM_NULL:			/*			 * (1) set CURRENT_FH to the file being opened,			 * creating it if necessary, (2) set open->op_cinfo,			 * (3) set open->op_truncate if the file is to be			 * truncated after opening, (4) do permission checking.			 */			status = do_open_lookup(rqstp, current_fh, open);			if (status)				goto out;			break;		case NFS4_OPEN_CLAIM_PREVIOUS:			/*			 * The CURRENT_FH is already set to the file being			 * opened.  (1) set open->op_cinfo, (2) set			 * open->op_truncate if the file is to be truncated			 * after opening, (3) do permission checking.			*/			status = do_open_fhandle(rqstp, current_fh, open);			if (status)				goto out;			break;             	case NFS4_OPEN_CLAIM_DELEGATE_PREV:			printk("NFSD: unsupported OPEN claim type %d\n",				open->op_claim_type);			status = nfserr_notsupp;			goto out;		default:			printk("NFSD: Invalid OPEN claim type %d\n",				open->op_claim_type);			status = nfserr_inval;			goto out;	}	/*	 * nfsd4_process_open2() does the actual opening of the file.  If	 * successful, it (1) truncates the file if open->op_truncate was	 * set, (2) sets open->op_stateid, (3) sets open->op_delegation.	 */	status = nfsd4_process_open2(rqstp, current_fh, open);out:	if (open->op_stateowner)		nfs4_get_stateowner(open->op_stateowner);	nfs4_unlock_state();	return status;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b648330a1d741d5df8a5076b2a0a2519c69c8f41/nfs4proc.c/buggy/fs/nfsd/nfs4proc.c