Thread (32 messages) 32 messages, 2 authors, 2018-01-26
STALE3080d

[PATCH 05/15] btrfs-progs: lowmem check: let check_dir_item() continue if find wrong inode_item

From: Su Yue <hidden>
Date: 2018-01-26 08:30:50
Subsystem: the rest · Maintainer: Linus Torvalds

check_dir_item can handle missed/mismatched inode item well.
Let it continue to check corresponding dir_item/index and inode_ref.

Signed-off-by: Su Yue <redacted>
---
 cmds-check.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
index e33dd7db0048..eb65a18fe64b 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -5984,15 +5984,12 @@ begin:
 		ret = btrfs_search_slot(NULL, root, &location, path, 0, 0);
 		if (ret) {
 			tmp_err |= INODE_ITEM_MISSING;
-			goto next;
-		}
-
-		ii = btrfs_item_ptr(path->nodes[0], path->slots[0],
-				    struct btrfs_inode_item);
-		mode = btrfs_inode_mode(path->nodes[0], ii);
-		if (imode_to_type(mode) != filetype) {
-			tmp_err |= INODE_ITEM_MISMATCH;
-			goto next;
+		} else {
+			ii = btrfs_item_ptr(path->nodes[0], path->slots[0],
+					    struct btrfs_inode_item);
+			mode = btrfs_inode_mode(path->nodes[0], ii);
+			if (imode_to_type(mode) != filetype)
+				tmp_err |= INODE_ITEM_MISMATCH;
 		}
 
 		/* Check relative INODE_REF/INODE_EXTREF */
-- 
2.16.1


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help