提交 d771e3a4 编写于 作者: B Benny Halevy 提交者: Trond Myklebust

NFSv4.1: fix break condition in pnfs_find_lseg

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: NPeng Tao <peng_tao@emc.com>
Signed-off-by: NBenny Halevy <benny@tonian.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 a2e1d4f2
...@@ -889,7 +889,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo, ...@@ -889,7 +889,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
ret = get_lseg(lseg); ret = get_lseg(lseg);
break; break;
} }
if (cmp_layout(range, &lseg->pls_range) > 0) if (lseg->pls_range.offset > range->offset)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册