diff options
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index beade5570b56..16c9fbdf97b4 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -849,9 +849,11 @@ static int nfs4_state_mark_reclaim_nograce(struct nfs_client *clp, struct nfs4_s | |||
849 | static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_recovery_ops *ops) | 849 | static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_recovery_ops *ops) |
850 | { | 850 | { |
851 | struct inode *inode = state->inode; | 851 | struct inode *inode = state->inode; |
852 | struct nfs_inode *nfsi = NFS_I(inode); | ||
852 | struct file_lock *fl; | 853 | struct file_lock *fl; |
853 | int status = 0; | 854 | int status = 0; |
854 | 855 | ||
856 | down_write(&nfsi->rwsem); | ||
855 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { | 857 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
856 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) | 858 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
857 | continue; | 859 | continue; |
@@ -874,8 +876,10 @@ static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_ | |||
874 | goto out_err; | 876 | goto out_err; |
875 | } | 877 | } |
876 | } | 878 | } |
879 | up_write(&nfsi->rwsem); | ||
877 | return 0; | 880 | return 0; |
878 | out_err: | 881 | out_err: |
882 | up_write(&nfsi->rwsem); | ||
879 | return status; | 883 | return status; |
880 | } | 884 | } |
881 | 885 | ||