update_stateid(&stp->st_stateid); 
nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open){	struct nfs4_file *fp = NULL;	struct inode *ino = current_fh->fh_dentry->d_inode;	struct nfs4_stateid *stp = NULL;	struct nfs4_delegation *dp = NULL;	int status;	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;	status = nfserr_inval;	if (!TEST_ACCESS(open->op_share_access) || !TEST_DENY(open->op_share_deny))		goto out;	/*	 * Lookup file; if found, lookup stateid and check open request,	 * and check for delegations in the process of being recalled.	 * If not found, create the nfs4_file struct	 */	fp = find_file(ino);	if (fp) {		if ((status = nfs4_check_open(fp, open, &stp)))			goto out;		status = nfs4_check_deleg(fp, open, &dp);		if (status)			goto out;	} else {		status = nfserr_bad_stateid;		if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR)			goto out;		status = nfserr_resource;		fp = alloc_init_file(ino);		if (fp == NULL)			goto out;	}	/*	 * OPEN the file, or upgrade an existing OPEN.	 * If truncate fails, the OPEN fails.	 */	if (stp) {		/* Stateid was found, this is an OPEN upgrade */		status = nfs4_upgrade_open(rqstp, current_fh, stp, open);		if (status)			goto out;	} else {		/* Stateid was not found, this is a new OPEN */		int flags = 0;		if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)			flags = MAY_WRITE;		else			flags = MAY_READ;		status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags);		if (status)			goto out;		init_stateid(stp, fp, open);		status = nfsd4_truncate(rqstp, current_fh, open);		if (status) {			release_stateid(stp, OPEN_STATE);			goto out;		}	}	memcpy(&open->op_stateid, &stp->st_stateid, sizeof(stateid_t));	/*	* Attempt to hand out a delegation. No error return, because the	* OPEN succeeds even if we fail.	*/	nfs4_open_delegation(current_fh, open, stp);	status = nfs_ok;	dprintk("nfs4_process_open2: stateid=(%08x/%08x/%08x/%08x)\n",	            stp->st_stateid.si_boot, stp->st_stateid.si_stateownerid,	            stp->st_stateid.si_fileid, stp->st_stateid.si_generation);out:	if (fp)		put_nfs4_file(fp);	if (status == 0 && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS)		nfs4_set_claim_prev(open);	/*	* To finish the open response, we just need to set the rflags.	*/	open->op_rflags = NFS4_OPEN_RESULT_LOCKTYPE_POSIX;	if (!open->op_stateowner->so_confirmed)		open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM;	return status;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/444c2c07c2d7a6936d1381d381ab80e3f5541427/nfs4state.c/buggy/fs/nfsd/nfs4state.c