diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-08 21:49:53 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-08 22:12:42 -0400 |
commit | 7a8203d8cbab63b7c556ebd00e12685a3ed176b5 (patch) | |
tree | cb96463948894dff1a1a61f2af19c5124056873f /fs/nfs | |
parent | 577b42327d707fbe7166aad6902c2eeee6a65015 (diff) |
NFS: Ensure that NFS file unlock waits for readahead to complete
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 29f4a48a0ee6..a87a44f84113 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -744,6 +744,7 @@ static int | |||
744 | do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) | 744 | do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) |
745 | { | 745 | { |
746 | struct inode *inode = filp->f_mapping->host; | 746 | struct inode *inode = filp->f_mapping->host; |
747 | struct nfs_lock_context *l_ctx; | ||
747 | int status; | 748 | int status; |
748 | 749 | ||
749 | /* | 750 | /* |
@@ -752,6 +753,14 @@ do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) | |||
752 | */ | 753 | */ |
753 | nfs_sync_mapping(filp->f_mapping); | 754 | nfs_sync_mapping(filp->f_mapping); |
754 | 755 | ||
756 | l_ctx = nfs_get_lock_context(nfs_file_open_context(filp)); | ||
757 | if (!IS_ERR(l_ctx)) { | ||
758 | status = nfs_iocounter_wait(&l_ctx->io_count); | ||
759 | nfs_put_lock_context(l_ctx); | ||
760 | if (status < 0) | ||
761 | return status; | ||
762 | } | ||
763 | |||
755 | /* NOTE: special case | 764 | /* NOTE: special case |
756 | * If we're signalled while cleaning up locks on process exit, we | 765 | * If we're signalled while cleaning up locks on process exit, we |
757 | * still need to complete the unlock. | 766 | * still need to complete the unlock. |