+0800, Su Yue wrote:
Added 'repair_inode_item' which dispatches functions such as
'repair_inode__nbytes_lowmem' to correct errors and
'struct inode_item_fix_info' to store correct values and errors.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c
Add a function named 'repair_inode_orphan_item_lowmem'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 50 +-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index f13ce317..fb
Introduce 'print_inode_ref' to print error msg while checking inode ref.
Add args 'name_ret' and 'namelen_ret' to 'check_inode_ref' because
they are essential while doing nlinks repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.
For further lowmem repairs, change the index type u64 to u64 *.
So we could get the index of ref.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 24 +++-
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
Introduce 'repair_inode_item_missing' to fix INODE_ITEM_MISSING
This patch is for further repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 43 +++
1 file changed, 43 insertions(+)
diff --git a/cmds-check.c b/cmds-check.c
Introduce '__create_inode' to create and insert inode item.
Modify origin 'create_inode_item' call it.
Create 'create_inode_item_lowmem' call it.
The patch is for further lowmem repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.
Add an arg 'ignore_existed' to btrfs_add_link.
If ignore_existed=1, continue to add while relative dir index/item
or inode ref is already existed.
This patch is for further repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 6 +++---
convert/main.c | 2 +-
c
Since lowmem mode can repair inode nbytes error now, modify this test case
to allow lowmem mode repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
v3: add this patch.
---
tests/fsck-tests/016-wrong-inode-nbytes/test.sh | 33 +
1 file changed, 33 inse
Added 'repair_inode_item' which dispatches functions such as
'repair_inode__nbytes_lowmem' to correct errors and
'struct inode_item_fix_info' to store correct values and errors.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
v2: reassign err to info.err after repaired in process_one_l
Add a function 'repair_inode_isize' to support inode isize repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
v2: none
v3: none
---
cmds-check.c | 49 -
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c
Add a function 'repair_inode_isize' to support inode isize repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 49 -
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index d
Added 'repair_inode_item' which dispatches functions such as
'repair_inode__nbytes_lowmem' to correct errors and
'struct inode_item_fix_info' to store correct values and errors.
v2:
reassign err to info.err in process_one_leaf.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
btrfs/104 doesn't redirect mkfs output correctly, which leads to false
alert.
Fix it.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
tests/btrfs/104 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/btrfs/104 b/tests/btrfs/104
index e6a6d3b..c8be4dd
Btrfs-progs v4.9 changed "device status" output by adding one more
space, which differs from golden output.
Fix it by introducing new filter to convert multi space into one.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
common/filter | 6 ++
tests/bt
Btrfs-progs v4.9 changed "device status" output by adding one more
space, which differs from golden output.
Fix it by using filter '_filter_spaces' to convert multi space into one.
---
v2:
Changed the '_filter_spaces' to match both Tab and Space and tested
all related tests.
---
common/filter
Add a function 'repair_inode_isize' to support inode isize repair.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 49 -
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 5
Added 'repair_inode_item' which dispatches functions such as
'repair_inode__nbytes_lowmem' to correct errors and
'struct inode_item_fix_info' to store correct values and errors.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c
On 03/31/2017 12:44 AM, David Sterba wrote:
On Wed, Mar 01, 2017 at 11:13:43AM +0800, Su Yue wrote:
It can be feched from my github:
https://github.com/Damenly/btrfs-progs.git lowmem_repair
This patchset can repair errors found in fs tree in lowmem mode.
This patchset request includes:
1
After checking one inode item, we should get the actual nbytes of the
inode item.
Introduce function 'repair_inode_nbytes_lowmem' to set nbytes in struct
btrfs_inode_item to the actual nbytes. After call of the function, the
wrong nbytes should have been corrected.
Signed-off-by: Su Yue <su
After traversal of whole directory, we should get the actual isize.
Introduce function 'repair_dir_isize_lowmem' to set isize in the directory
inode item to actual size. After call of the function, the wrong dir isize
should have been corrected.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.
From: Qu Wenruo
Since lowmem mode can repair certain corruptions (mostly in fs tree),
insert a beacon into each fsck test cases to allow some of them be
tested for lowmem mode.
With this patch, fsck option override will check the beacon file
".lowmem_repairbale" in the
Enable btrfsck option '--repair' with option '--mode=lowmem'.
Now lowmem mode only repairs wrong nbytes, dir isize.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
index 6a
cases
Su Yue (4):
btrfs-progs: check: inode nbytes fix in lowmem
btrfs-progs: check: dir isize fix in lowmem
btrfs-progs: check: enable lowmem repair
btrfs-progs: fsck-check: test cases for nbytes and dir isize
cmds-check.c | 149
Create test case '026-wrong-dir-inode-isize'.
Create becon files '.lowmem_repairable' under tests/fsck-test/016 and 026.
Now 'make test-fsck' will test lowmem repairable test cases if
TEST_ENABLE_OVERRIDE=true.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
.../fsck-tests/016-wrong
Introduce 'repair_inode_nlinks_lowmem'.
If ref is 0, move the inode to "lost + found".
Set inode item's nlink to ref_count.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 233 +--
1 file changed, 179 i
Introduce 'repair_ternary_lowmem' to repair error while checking
dir_item/index, inode_ref by the rule:
1. If two of three is missing or mismatched, delete the existed one.
2. If one of three is missing or mismatched, add the missing one.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
Add a function 'repair_inode_nbytes_lowmem' to correct inode item nbytes
error in lowmem mode.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 82 +++-
1 file changed, 76 insertions(+), 6 deletions(-)
diff --git
Add a function 'repair_dir_isize_lowmem' to support dir isize
repair in lowmem mode.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 69 +---
1 file changed, 66 insertions(+), 3 deletions(-)
diff --git a/cmds-che
Call repair_ternary_lowmem while checking inode ref.
Introduce 'repair_dir_item' calls above function to repair dir_item.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 29 +++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git
For further lowmem_repair, introduce 'find_dir_index' to
get the index by other inode item information.
Remove 'check_dir_item' error msg print.
Adjust 'find_dir_item' args and remove err msg print.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c
Introduce 'repair_dir_item' to repair dir item/index missing/mismatch
and relative inode item missing while checking.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 78
1 file changed, 78 insertions(+)
diff
From: Qu Wenruo
Since lowmem mode can repair certain corruptions (mostly in fs tree),
insert a beacon into each fsck test cases to allow some of them be
tested for lowmem mode.
With this patch, fsck option override will check the beacon file
".lowmem_repairbale" in the
Introduce 'print_dir_item_err' to print error msg while
checking dir_item/dir_index.
'check_dir_item' now checks relative dir item and calls
'print_dir_itm_err" to print error msg.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-ch
mode.
Qu Wenruo (1):
btrfs-progs: fsck-check: Allow fsck check test to repair in lowmem
mode for certain test cases
Su Yue (19):
btrfs-progs: cmds-check.c: supports inode nbytes fix in lowmem
btrfs-progs: cmds-check.c: supports dir isize fix in lowmem
btrfs-progs: cmds-check.c: inode
Introduce 'count_dir_isize' to get dir isize.
This function is called only under lowmme repair mode.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 95 ++--
1 file changed, 92 insertions(+), 3 deletions(-)
diff
Introduce 'punch_extent_hole' to punch holes while
repair file extent.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 51 +--
1 file changed, 45 insertions(+), 6 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
Introduce 'repair_fs_first_inode' to repair first inode errors.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 69
1 file changed, 69 insertions(+)
diff --git a/cmds-check.c b/cmds-check.c
index 6dafbd7d..85
Modify check_fs_first_inode to check firt_inode inode item and inode ref.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 57 ++---
1 file changed, 42 insertions(+), 15 deletions(-)
diff --git a/cmds-check.c b/cmds-c
t; matches with 54846528,
while hash of "deprecated.sxt" should be 2008317993.
Reported-by: Filippe LeMarchand <gasinv...@gmail.com>
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 8
1 file changed, 8 insertions(+)
diff --git a/cmds-check.c b/cmds-
In this test case, all name in dir_item, dir_index, inode_ref
are corrupted to another one.
btrfs check should report errors about the corrupted dir_item but
btrfs can't repair the case now.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
.../fsck-tests/026-bad-dir-ite
Although lowmem mode can detect name and hash mismatch in dir_item,
it's done by checking inode_ref to expose such problem.
This patch will enhance dir_item check, by also comparing name and
hash when checking dir_items.
Reported-by: Filippe LeMarchand <gasinv...@gmail.com>
Signed-off-by:
to be same as fs tree which calls
walk_down_tree_v2() and walk_up_tree_v2() is easy for further
repair. And now check_***_items() is with btrfs_path.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 325 +--
1 file c
subscribe linux-btrfs
--
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
Thanks a lot.
I'm sorry for that I hadn't noticed those emails during the vacation.
On 06/30/2017 02:20 AM, David Sterba wrote:
The XATTR_ITEM is a type of a directory item so we use the common
validator helper. Unlike other dir items, it can have data. The way the
name len validation is
Hi
This patchset was sent a month ago.
Since it's a start of lowmem repair patches, I hope to get some
opinions about it.
Thanks
Su Yue
On 04/11/2017 11:26 AM, Su Yue wrote:
The series include following contents:
1) Repair wrong nbytes of file inode item.
After traversal
In verify_dir_item, it wants to printk name_len of dir_item but
printk data_len acutally.
Fix it by calling btrfs_dir_name_len instead of btrfs_dir_data_len.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/dir-item.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
namelen with item boundary by
calling 'btrfs_check_namelen'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 +-
fs/btrfs/dir-item.c | 13 -
fs/btrfs/inode.c| 2 +-
fs/btrfs/tree-log.c | 4 ++--
fs/btrfs/xattr.c| 2 +-
5 files chang
compares arg @namelen with boundary then returns 'proper'
namelen.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 ++
fs/btrfs/dir-item.c | 22 ++
2 files changed, 24 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
ise, call 'check_btrfs_namelen' to get 'proper' namelen.
If the returned value is not equal to original namelen,
returns with error.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/dir-item.c | 5 ++--
fs/btrfs/export.c | 7 +
fs/btrfs/inode-item.c | 11 +++-
After checking one inode item, we should get the actual nbytes of the
inode item.
Introduce function 'repair_inode_nbytes_lowmem' to set nbytes in struct
btrfs_inode_item to the actual nbytes. After call of the function, the
wrong nbytes should have been corrected.
Signed-off-by: Su Yue <su
to repair in lowmem
mode for certain test cases
Su Yue (4):
btrfs-progs: check: inode nbytes fix in lowmem
btrfs-progs: check: dir isize fix in lowmem
btrfs-progs: check: enable lowmem repair
btrfs-progs: fsck-check: test cases for nbytes and dir isize
cmds-check.c
From: Qu Wenruo
Since lowmem mode can repair certain corruptions (mostly in fs tree),
insert a beacon into each fsck test cases to allow some of them be
tested for lowmem mode.
With this patch, fsck option override will check the beacon file
".lowmem_repairbale" in the
Create test case '026-wrong-dir-inode-isize'.
Create becon files '.lowmem_repairable' under tests/fsck-test/016 and 026.
Now 'make test-fsck' will test lowmem repairable test cases if
TEST_ENABLE_OVERRIDE=true.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
.../fsck-tests/016-wrong
Enable btrfsck option '--repair' with option '--mode=lowmem'.
Now lowmem mode only repairs wrong nbytes, dir isize.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
index cf
After traversal of whole directory, we should get the actual isize.
Introduce function 'repair_dir_isize_lowmem' to set isize in the directory
inode item to actual size. After call of the function, the wrong dir isize
should have been corrected.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.
On 05/29/2017 11:43 PM, David Sterba wrote:
This patch adds the name length verification to many places and in some
of them it looks unnecessary, as the directory item passes sanity checks
already. The verification should always happen when we read the input,
ie from disk, after search_slot
On 06/01/2017 05:44 PM, Nikolay Borisov wrote:
On 1.06.2017 11:57, Su Yue wrote:
Introduce function btrfs_is_namelen_valid.
The function compares arg @namelen with item boundary then returns value
represents namelen is valid or not.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.
Call 'verify_dir_item' to check namelen in 'replay_xattr_deletes'
in avoid of read out of boundary.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/tree-log.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 7d9885
Since 'iterate_dir_item' checks namelen in its way,
use 'btrfs_is_namelen_valid' not 'verify_dir_item'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/send.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index fc496a6f842a..caf96a
Call 'Verify dir_item' before memcmp_extent_buffer.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/props.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index d6cb155ef7a1..4b23ae5d0e5c 100644
--- a/fs/btrfs/props.c
+++ b/fs
Call 'btrfs_is_namelen_valid' in 'btrfs_get_name'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/export.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c
index 87144c9f9593..213e971e8dcf 100644
--- a/fs/btrfs/export.c
+++ b/fs
Call 'btrfs_is_namelen_valid' before reading name.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/tree-log.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index ae51144571e2..fdab0f021197 100644
--- a/fs/btrfs/tree-log.c
++
and check namelen with item boundary
by calling 'btrfs_is_namelen_valid'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 +-
fs/btrfs/dir-item.c | 10 +-
fs/btrfs/inode.c| 2 +-
fs/btrfs/tree-log.c | 4 ++--
fs/btrfs/xattr.c| 2 +-
5 fi
Introduce function btrfs_is_namelen_valid.
The function compares arg @namelen with item boundary then returns value
represents namelen is valid or not.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 ++
fs/btrfs/dir-item.
' to 'btrfs_is_namelen_valid'.
2.Split patches according call graph.
Su Yue (9):
btrfs: Introduce btrfs_is_namelen_valid to avoid reading beyond
boundary
btrfs: Check namelen with boundary in verify dir_item
btrfs: Check name len on add_inode_ref call path
btrfs: Verify dir_item
-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/dir-item.c | 4 ++--
fs/btrfs/tree-log.c | 27 ++-
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index f9d1ca76ca04..38dc5176cc5b 100644
--- a/fs/btrfs/dir-
Call btrfs_is_namelen_valid before memcmp.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/root-tree.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 7d6bc308bf43..7a5450600723 100644
--- a/fs/btrfs/root-tree.c
++
-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/dir-item.c | 4 ++--
fs/btrfs/tree-log.c | 27 ++-
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index 806b9fe0178a..dc42066cbaeb 100644
--- a/fs/btrfs/dir-
Since 'iterate_dir_item' checks name_len in its way,
so use 'btrfs_is_name_len_valid' not 'verify_dir_item' to make more strict
name_len check.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/send.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/send.c b/fs
' in function and changelog.
Su Yue (9):
btrfs: Introduce btrfs_is_name_len_valid to avoid reading beyond
boundary
btrfs: Check name_len with boundary in verify dir_item
btrfs: Check name_len on add_inode_ref call path
btrfs: Verify dir_item in replay_xattr_deletes
btrfs: Check name_len
On 06/15/2017 11:57 PM, David Sterba wrote:
On Tue, Jun 06, 2017 at 05:56:59PM +0800, Su Yue wrote:
When reading out name from inode_ref, dir_item, it's possible that
corrupted name_len leads to read beyond boundary.
Since there are already patches for btrfs-progs, this patchset is
for btrfs
iterating over
backrefs.
So let it continue to next step after free can fix it.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 5cc84690..c910e520 100644
--- a/cmds-check.c
+++
after free can fix it.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 897b1587..e52fbb84 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2666,6 +2666,7 @
ter @slot and check name_len with item boundary
by calling 'btrfs_is_name_len_valid'.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 +-
fs/btrfs/dir-item.c | 10 +-
fs/btrfs/inode.c| 2 +-
fs/btrfs/tree-log.c | 4 ++--
fs/btrfs/xattr.c| 2 +-
5 fi
Call 'Verify dir_item' before 'memcmp_extent_buffer' reading name from
dir_item.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/props.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index d6cb155ef7a1..4b23ae5d0e5c 100644
--
Introduce function btrfs_is_name_len_valid.
The function compares arg @name_len with item boundary then returns value
represents name_len is valid or not.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/ctree.h| 2 ++
fs/btrfs/dir-item.
'btrfs_del_root_ref' does search_slot and reads name from root_ref.
Call 'btrfs_is_name_len_valid' before memcmp.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/root-tree.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
'replay_xattr_deletes' calls 'btrfs_search_slot' to get buffer and
reads name.
Call 'verify_dir_item' to check name_len in 'replay_xattr_deletes'
in avoid of read out of boundary.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/tree-log.c | 7 +++
1 file changed, 7 inse
In 'btrfs_log_inode', 'btrfs_search_forward' gets the buffer and then
'btrfs_check_ref_name_override' will read name from inode_ref/inode_extref
for the first time.
Call 'btrfs_is_name_len_valid' before reading name.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/tree-log
In 'btrfs_get_name', it does 'btrfs_search_slot' and reads name from
inode_ref/root_ref.
Call btrfs_is_name_len_valid in btrfs_get_name.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
fs/btrfs/export.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/export.c b/fs
(_start+0x2a)[0x55fabc267e7a]
[1]5188 abort (core dumped) btrfs check --mode=lowmem /tmp/data_small
Fix it by checking type before obtaining inline_ref size.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 9 +
1 file changed, 9 insertions(+)
diff --git
On 09/19/2017 04:48 PM, Qu Wenruo wrote:
On 2017年09月19日 16:32, Su Yue wrote:
Lowmem check does not skip invalid type in extent_inline_ref then
calls btrfs_extent_inline_ref_size(type) which causes crash.
Example:
$ ./btrfs-corrupt-block -e -l 20971520 /tmp/data_small
corrupting extent
On 10/06/2017 01:46 AM, David Sterba wrote:
On Wed, Sep 27, 2017 at 02:34:36PM +0800, Su Yue wrote:
In original check mode(without option "--repair"), check_extent_refs()
always returns 0.
Add a variable @error to record status while checking extents.
At the end of check_extent_r
On 10/06/2017 01:46 AM, David Sterba wrote:
On Wed, Sep 27, 2017 at 02:34:36PM +0800, Su Yue wrote:
In original check mode(without option "--repair"), check_extent_refs()
always returns 0.
Add a variable @error to record status while checking extents.
At the end of check_extent_r
From: Zhang Yu
In fuzz-tests/004-simple-dump-tree:
Since there is one wrong item(DATA_RELOC_TREE CHUNK_ITEM 0) in root
tree.
It fails as follow:
ctree.h:317: btrfs_chunk_item_size: BUG_ON `num_stripes == 0` triggered, value 1
Hi
During writing patches about check, I found something confusing
about btrfs-progs original check.
Setup:
Version: Btrfs progs v4.13.1
$ make TEST=006\* test-fsck
[TEST] fsck-tests.sh
[TEST/fsck] 006-bad-root-items
$ cat tests/fsck-tests-results.txt | tail -n 25
###
On 09/24/2017 10:17 PM, Nikolay Borisov wrote:
On 19.09.2017 13:00, Qu Wenruo wrote:
On 2017年09月19日 17:48, Su Yue wrote:
On 09/19/2017 04:48 PM, Qu Wenruo wrote:
On 2017年09月19日 16:32, Su Yue wrote:
Lowmem check does not skip invalid type in extent_inline_ref then
calls
by making _skip_spec() always be defined in common.local.
Reported-by: David Sterba <dste...@suse.cz>
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
tests/common | 8 ++--
tests/common.local | 11 +--
2 files changed, 7 insertions(+), 12 deletions(-)
diff
Solve it by introducing check_extent_inline_ref() to check type.
If the checker returns a nonzero value, we should not check the
corrupted extent item anymore.
Suggested-by: Qu Wenruo <quwenruo.bt...@gmx.com>
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-
pace waste bytes: 109471
file data blocks allocated: 0
referenced 0
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 8aa136df..93b47194 100644
--- a/cmds-check.c
++
not be modified if repair_root_items() succeeded
in original repair.
The late two patches are about invalid type in extent_inline_ref.
Only original mode applied 001-003 patches can handle the case in the
last patch. So I gather those 5 patches together.
Su Yue (5):
btrfs-progs: check: return
Return value of repair_root_items():
<0 on error
=0 does nothing
>0 if repair is enable, N roots is repaired;
else N roots is corrupted.
In the repair mode, there should be no error if return value is bigger
than 0.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check
This case is for avoiding crash in lowmem check mode.
Field type of extent_inline_ref in an extent is corrupted.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
.../bad-extent-inline-ref-type.raw.xz | Bin 0 -> 17144 bytes
1 file changed, 0 insertions(+), 0
r_root_items() if do init_extent_tree.
Then test-fsck/013 works well.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 43 +++
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
index 93b47194..3e2f9faa 10064
d
not call repair_root_items() if do init_extent_tree.
Then test-fsck/013 works well.
---
Changelog:
v2:
Correct commit number reported. (Suggested by Qu Wenruo)
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 43 +++
1
is nonzero.
Now put repair_root_items() before do_check_chunks_and_extents() and
not call repair_root_items() if do init_extent_tree.
Then test-fsck/013 works well.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
Changelog:
v2:
Correct commit number reported. (Suggested by Qu Wenruo)
v
Hi
On 11/11/2017 07:16 AM, Chris Murphy wrote:
Resurrecting this old thread because I'm still seeing these errors.
On Thu, Mar 16, 2017 at 6:54 PM, Qu Wenruo wrote:
At 03/17/2017 07:22 AM, Chris Murphy wrote:
With kernel 4.10.3, and btrfs-progs 4.10, I'm still
.
2) Repair in lowmem mode always reports error about block group accounting.
The third patch excludes extents of all treeblocks and extent items to
avoid wrong extent overwrite. Then repair in lowmem mode should work
again.
Su Yue (3):
btrfs-progs: check: release path in repair_extent_data_item
In repair_extent_data_item(), path is not be released if some
errors occurs which causes extent buffer leak.
So release path in end of the function.
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-c
nonzero value even the filesystem is fine after repair.
So let @err contains bits after walk_down_tree_v2().
Signed-off-by: Su Yue <suy.f...@cn.fujitsu.com>
---
cmds-check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 3a72f8
1 - 100 of 453 matches
Mail list logo