]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfsd/vfs.c
Use f_lock to protect f_flags
[linux-2.6-omap-h63xx.git] / fs / nfsd / vfs.c
index 5245a3965004259f2d156d495875260b7d254a6b..c165a6403df03e52219925b875ef420adcbd331a 100644 (file)
@@ -764,7 +764,6 @@ static inline int nfsd_dosync(struct file *filp, struct dentry *dp,
 
        return err;
 }
-       
 
 static int
 nfsd_sync(struct file *filp)
@@ -999,8 +998,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 
        if (!EX_ISSYNC(exp))
                stable = 0;
-       if (stable && !EX_WGATHER(exp))
+       if (stable && !EX_WGATHER(exp)) {
+               spin_lock(&file->f_lock);
                file->f_flags |= O_SYNC;
+               spin_unlock(&file->f_lock);
+       }
 
        /* Write the data. */
        oldfs = get_fs(); set_fs(KERNEL_DS);