Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[sfrench/cifs-2.6.git] / fs / nfsd / vfs.c
index ad38fc9e5816df447c8bcec881a82bca5caa6e07..78376b6c0236161009488e0bf4f3a2a707c3bc44 100644 (file)
@@ -998,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);