diff options
-rw-r--r-- | fs/nfs/pnfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index c7be9b997f5e..9304984bde80 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1788,10 +1788,16 @@ pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, | |||
1788 | seg_end = end_offset(pgio->pg_lseg->pls_range.offset, | 1788 | seg_end = end_offset(pgio->pg_lseg->pls_range.offset, |
1789 | pgio->pg_lseg->pls_range.length); | 1789 | pgio->pg_lseg->pls_range.length); |
1790 | req_start = req_offset(req); | 1790 | req_start = req_offset(req); |
1791 | WARN_ON_ONCE(req_start > seg_end); | 1791 | WARN_ON_ONCE(req_start >= seg_end); |
1792 | /* start of request is past the last byte of this segment */ | 1792 | /* start of request is past the last byte of this segment */ |
1793 | if (req_start >= seg_end) | 1793 | if (req_start >= seg_end) { |
1794 | /* reference the new lseg */ | ||
1795 | if (pgio->pg_ops->pg_cleanup) | ||
1796 | pgio->pg_ops->pg_cleanup(pgio); | ||
1797 | if (pgio->pg_ops->pg_init) | ||
1798 | pgio->pg_ops->pg_init(pgio, req); | ||
1794 | return 0; | 1799 | return 0; |
1800 | } | ||
1795 | 1801 | ||
1796 | /* adjust 'size' iff there are fewer bytes left in the | 1802 | /* adjust 'size' iff there are fewer bytes left in the |
1797 | * segment than what nfs_generic_pg_test returned */ | 1803 | * segment than what nfs_generic_pg_test returned */ |