aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/file_table.c2
-rw-r--r--fs/nfsd/nfs4state.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index b98404b54383..32d12b78bac8 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -393,7 +393,9 @@ retry:
393 continue; 393 continue;
394 if (!(f->f_mode & FMODE_WRITE)) 394 if (!(f->f_mode & FMODE_WRITE))
395 continue; 395 continue;
396 spin_lock(&f->f_lock);
396 f->f_mode &= ~FMODE_WRITE; 397 f->f_mode &= ~FMODE_WRITE;
398 spin_unlock(&f->f_lock);
397 if (file_check_writeable(f) != 0) 399 if (file_check_writeable(f) != 0)
398 continue; 400 continue;
399 file_release_write(f); 401 file_release_write(f);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index f19ed866c95f..fcafe6087f69 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1998,7 +1998,9 @@ nfs4_file_downgrade(struct file *filp, unsigned int share_access)
1998{ 1998{
1999 if (share_access & NFS4_SHARE_ACCESS_WRITE) { 1999 if (share_access & NFS4_SHARE_ACCESS_WRITE) {
2000 drop_file_write_access(filp); 2000 drop_file_write_access(filp);
2001 spin_lock(&filp->f_lock);
2001 filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE; 2002 filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
2003 spin_unlock(&filp->f_lock);
2002 } 2004 }
2003} 2005}
2004 2006