diff options
| -rw-r--r-- | fs/nfs/pnfs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 0f42e02436ee..29c0ca7fc347 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
| @@ -1078,11 +1078,22 @@ pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, | |||
| 1078 | return true; | 1078 | return true; |
| 1079 | } | 1079 | } |
| 1080 | 1080 | ||
| 1081 | if (req_offset(req) > end_offset(pgio->pg_lseg->pls_range.offset, | 1081 | /* |
| 1082 | pgio->pg_lseg->pls_range.length)) | 1082 | * Test if a nfs_page is fully contained in the pnfs_layout_range. |
| 1083 | return false; | 1083 | * Note that this test makes several assumptions: |
| 1084 | 1084 | * - that the previous nfs_page in the struct nfs_pageio_descriptor | |
| 1085 | return true; | 1085 | * is known to lie within the range. |
| 1086 | * - that the nfs_page being tested is known to be contiguous with the | ||
| 1087 | * previous nfs_page. | ||
| 1088 | * - Layout ranges are page aligned, so we only have to test the | ||
| 1089 | * start offset of the request. | ||
| 1090 | * | ||
| 1091 | * Please also note that 'end_offset' is actually the offset of the | ||
| 1092 | * first byte that lies outside the pnfs_layout_range. FIXME? | ||
| 1093 | * | ||
| 1094 | */ | ||
| 1095 | return req_offset(req) < end_offset(pgio->pg_lseg->pls_range.offset, | ||
| 1096 | pgio->pg_lseg->pls_range.length); | ||
| 1086 | } | 1097 | } |
| 1087 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_test); | 1098 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_test); |
| 1088 | 1099 | ||
