diff options
author | Weston Andros Adamson <dros@primarydata.com> | 2014-08-08 11:00:55 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-22 18:04:43 -0400 |
commit | bfd484a5606d6a0379a0a2f04251b1e5c1f8995c (patch) | |
tree | 1f6499d6a822195a74cb8ed7f284013654293cbf /fs/nfs/pagelist.c | |
parent | bc8a309e88a86205fc3e17f06e42a2e56fc6f807 (diff) |
nfs: use blocking page_group_lock in add_request
__nfs_pageio_add_request was calling nfs_page_group_lock nonblocking, but
this can return -EAGAIN which would end up passing -EIO to the application.
There is no reason not to block in this path, so change the two calls to
do so. Also, there is no need to check the return value of
nfs_page_group_lock when nonblock=false, so remove the error handling code.
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Reviewed-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 89d5d433e351..30c9626f96b0 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -864,13 +864,8 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, | |||
864 | struct nfs_page *subreq; | 864 | struct nfs_page *subreq; |
865 | unsigned int bytes_left = 0; | 865 | unsigned int bytes_left = 0; |
866 | unsigned int offset, pgbase; | 866 | unsigned int offset, pgbase; |
867 | int ret; | ||
868 | 867 | ||
869 | ret = nfs_page_group_lock(req, true); | 868 | nfs_page_group_lock(req, false); |
870 | if (ret < 0) { | ||
871 | desc->pg_error = ret; | ||
872 | return 0; | ||
873 | } | ||
874 | 869 | ||
875 | subreq = req; | 870 | subreq = req; |
876 | bytes_left = subreq->wb_bytes; | 871 | bytes_left = subreq->wb_bytes; |
@@ -892,11 +887,7 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, | |||
892 | if (desc->pg_recoalesce) | 887 | if (desc->pg_recoalesce) |
893 | return 0; | 888 | return 0; |
894 | /* retry add_request for this subreq */ | 889 | /* retry add_request for this subreq */ |
895 | ret = nfs_page_group_lock(req, true); | 890 | nfs_page_group_lock(req, false); |
896 | if (ret < 0) { | ||
897 | desc->pg_error = ret; | ||
898 | return 0; | ||
899 | } | ||
900 | continue; | 891 | continue; |
901 | } | 892 | } |
902 | 893 | ||