Skip to content

Commit

Permalink
NFSv4.1: fix break condition in pnfs_find_lseg
Browse files Browse the repository at this point in the history
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
range.

Reported-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Benny Halevy <benny@tonian.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Jun 15, 2011
1 parent a2e1d4f commit d771e3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
ret = get_lseg(lseg);
break;
}
if (cmp_layout(range, &lseg->pls_range) > 0)
if (lseg->pls_range.offset > range->offset)
break;
}

Expand Down

0 comments on commit d771e3a

Please sign in to comment.