In the case that a extent doesn't have inline ref, this function
shouldn't report ITEM_SIZE_MISMATCH.

Signed-off-by: Lu Fengqi <lufq.f...@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwen...@cn.fujitsu.com>
---
 cmds-check.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmds-check.c b/cmds-check.c
index c52eebc..9fe3643 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -10373,7 +10373,11 @@ static int check_extent_item(struct btrfs_fs_info 
*fs_info,
        }
        end = (unsigned long)ei + item_size;
 
-       if (ptr >= end) {
+       if (ptr == end) {
+               goto out;
+       } else if (ptr > end) {
+               error("bad extent item [%llu %u %llu] size wrong",
+                     key.objectid, key.type, key.offset);
                err |= ITEM_SIZE_MISMATCH;
                goto out;
        }
-- 
2.7.4



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to