dnotify_parent(file->f_dentry, DN_MODIFY); 
fsnotify_modify(file->f_dentry); 
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,				loff_t offset, struct kvec *vec, int vlen,	   			unsigned long cnt, int *stablep){	struct svc_export	*exp;	struct dentry		*dentry;	struct inode		*inode;	mm_segment_t		oldfs;	int			err = 0;	int			stable = *stablep;	err = nfserr_perm;#ifdef MSNFS	if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&		(!lock_may_write(file->f_dentry->d_inode, offset, cnt)))		goto out;#endif	dentry = file->f_dentry;	inode = dentry->d_inode;	exp   = fhp->fh_export;	/*	 * Request sync writes if	 *  -	the sync export option has been set, or	 *  -	the client requested O_SYNC behavior (NFSv3 feature).	 *  -   The file system doesn't support fsync().	 * When gathered writes have been configured for this volume,	 * flushing the data to disk is handled separately below.	 */	if (file->f_op->fsync == 0) {/* COMMIT3 cannot work */	       stable = 2;	       *stablep = 2; /* FILE_SYNC */	}	if (!EX_ISSYNC(exp))		stable = 0;	if (stable && !EX_WGATHER(exp))		file->f_flags |= O_SYNC;	/* Write the data. */	oldfs = get_fs(); set_fs(KERNEL_DS);	err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);	set_fs(oldfs);	if (err >= 0) {		nfsdstats.io_write += cnt;		dnotify_parent(file->f_dentry, DN_MODIFY);	}	/* clear setuid/setgid flag after write */	if (err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) {		struct iattr	ia;		ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID;		down(&inode->i_sem);		notify_change(dentry, &ia);		up(&inode->i_sem);	}	if (err >= 0 && stable) {		static ino_t	last_ino;		static dev_t	last_dev;		/*		 * Gathered writes: If another process is currently		 * writing to the file, there's a high chance		 * this is another nfsd (triggered by a bulk write		 * from a client's biod). Rather than syncing the		 * file with each write request, we sleep for 10 msec.		 *		 * I don't know if this roughly approximates		 * C. Juszak's idea of gathered writes, but it's a		 * nice and simple solution (IMHO), and it seems to		 * work:-)		 */		if (EX_WGATHER(exp)) {			if (atomic_read(&inode->i_writecount) > 1			    || (last_ino == inode->i_ino && last_dev == inode->i_sb->s_dev)) {				dprintk("nfsd: write defer %d\n", current->pid);				msleep(10);				dprintk("nfsd: write resume %d\n", current->pid);			}			if (inode->i_state & I_DIRTY) {				dprintk("nfsd: write sync %d\n", current->pid);				nfsd_sync(file);			}#if 0			wake_up(&inode->i_wait);#endif		}		last_ino = inode->i_ino;		last_dev = inode->i_sb->s_dev;	}	dprintk("nfsd: write complete err=%d\n", err);	if (err >= 0)		err = 0;	else 		err = nfserrno(err);out:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/0eeca28300df110bd6ed54b31193c83b87921443/vfs.c/buggy/fs/nfsd/vfs.c