diff mbox

NFSv4.1: fix break condition in pnfs_find_lseg

Message ID 1308083416-22126-1-git-send-email-benny@tonian.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy June 14, 2011, 8:30 p.m. UTC
The break condition to skip out of the loop got broken when cmp_layout
was change.  Essentially, we want to stop looking once we know no layout
on the remainder of the list can match the first byte of the looked-up

Reported-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Benny Halevy <benny@tonian.com>
 fs/nfs/pnfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox


diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 08c115d..b3994e1 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -895,7 +895,7 @@  pnfs_find_lseg(struct pnfs_layout_hdr *lo,
 			ret = get_lseg(lseg);
-		if (cmp_layout(range, &lseg->pls_range) > 0)
+		if (lseg->pls_range.offset > range->offset)