Merge branch 'for-2.6.34' of git://linux-nfs.org/~bfields/linux
[linux-2.6.git] / fs / nfsd / nfs4state.c
index 3a20c09..c97fddb 100644 (file)
@@ -1998,7 +1998,9 @@ nfs4_file_downgrade(struct file *filp, unsigned int share_access)
 {
        if (share_access & NFS4_SHARE_ACCESS_WRITE) {
                drop_file_write_access(filp);
+               spin_lock(&filp->f_lock);
                filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
+               spin_unlock(&filp->f_lock);
        }
 }