Re: [report] lockdep warning when mounting seed device

2021-02-26 Thread damenly
> On Feb 27, 2021, at 09:12, Chris Murphy wrote: > > On Wed, Feb 24, 2021 at 9:40 PM Su Yue wrote: >> >> >> While playing with seed device(misc/next and v5.11), lockdep >> complains the following: >> >> To reproduce: >> >> dev1=/dev/sdb1 >> dev2=/dev/sdb2 >> >> umount /mnt >> >> mkfs.bt

[PATCH] btrfs-progs: mkfs-tests/005: check global prereq for dmsetup

2019-10-23 Thread damenly . su
From: Su Yue This test uses tool dmsetup so add the global prereq. Link: https://github.com/kdave/btrfs-progs/issues/192 Signed-off-by: Su Yue --- tests/mkfs-tests/005-long-device-name-for-ssd/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/mkfs-tests/005-long-device-name-for

[PATCH] btrfs-progs: misc-tests/029: exit manually after run_mayfail()

2019-06-23 Thread damenly . su
From: Su Yue Since the commmit 8dd3e5dc2df5 ("btrfs-progs: tests: fix misc-tests/029 to run on NFS") added the compatibility of NFS, it called run_mayfail() in the last of the test. However, run_mayfail() always return the original code. If the test case is not running on NFS, the last `run_mayf

[PATCH] btrfs-progs: fix invalid memory write in get_fs_info()

2019-06-02 Thread damenly . su
From: Su Yue As the link reported, btrfs fi sh may crash while a device is removing. valgrind reported: == ... ==883== Invalid write of size 8 ==883==at 0x13C99A: get_device_info (in /usr/bin/btrfs) ==883==by 0x13D715: g

[PATCH] btrfs-progs: trivial fix about line breaker in repair_inode_nbytes_lowmem()

2018-12-01 Thread damenly . su
From: Su Yue Move "\n" at end of the sentence to print. Fixes: 281eec7a9ddf ("btrfs-progs: check: repair inode nbytes in lowmem mode") Signed-off-by: Su Yue --- check/mode-lowmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c ind

[PATCH v2 03/13] btrfs-progs: lowmem: fix false alert if extent item has been repaired

2018-12-01 Thread damenly . su
From: Su Yue Previously, @err are assigned immediately after check but before repair. repair_extent_item()'s return value also confuses the caller. If error has been repaired and returns 0, check_extent_item() will try to continue check the nonexistent and cause false alerts. Here make repair_ex

[PATCH v2 02/13] btrfs-progs: lowmem: move nbytes check before isize check

2018-12-01 Thread damenly . su
From: Su Yue For files, lowmem repair will try to check nbytes and isize, but isize check depends nbytes. Once bytes has been repaired, then isize should be checked and repaired. So move nbytes check before isize check. Also set nbytes to extent_size once repaired successfully. Signed-off-by: S

[PATCH v2 01/13] btrfs-progs: lowmem: add argument path to punch_extent_hole()

2018-12-01 Thread damenly . su
From: Su Yue Since repair will do CoW, the outer path may be invalid, add an argument path to punch_extent_hole(). When punch_extent_hole() returns, path will still point to the item before calling punch_extent_hole(); Signed-off-by: Su Yue --- Changelog: v2: Remove varaiable @ret2. Call bt

[PATCH v2 7/7] btrfs-progs: fsck-tests: add test case inode_extref without dir_item and dir_index

2018-09-12 Thread damenly . su
From: Su Yue This case contains an inode_extref: == ... item 1 key (257 INODE_EXTREF 3460996356) itemoff 3947 itemsize 24 index 257 parent 256 namelen 6 name: foo255 ... == The related dir_item and

[PATCH v2 6/7] btrfs-progs: lowmem: improve check_inode_extref()

2018-09-12 Thread damenly . su
From: Su Yue inode_extref is much similar with inode_ref, most codes are reused in check_inode_extref(). Exception: There is no need to check root directory, so remove it. Make check_inode_extref() verify hash value with key offset now. And lowmem check can detect errors about inode_extref and t

[PATCH v2 5/7] btrfs-progs: lowmem: continue to check item in last slot while checking inodes

2018-09-12 Thread damenly . su
From: Su Yue After call of check_inode_item(), path may point to the last unchecked slot of the leaf. The outer walk_up_tree() always treats the position as checked item then skips to next item. If the last item was an inode item, yes, it was unchecked. Then walk_up_tree() will think the leaf is

[PATCH v2 0/7] btrfs-progs: lowmem: bug fixes and inode_extref repair

2018-09-12 Thread damenly . su
From: Su Yue This patchset can be fetched from my github(based on v4.17.1): https://github.com/Damenly/btrfs-progs/tree/lowmem_extref The patchset aims to support check and repair errors about inode_extref in lowmem mode. patch[1-2] let btrfs_unlink() detect inode_extref. patch[3] fixes a

[PATCH v2 2/7] btrfs-progs: make btrfs_unlink() lookup inode_extref

2018-09-12 Thread damenly . su
From: Su Yue btrfs_unlink() uses btrfs_lookup_inode_ref() to look up inode_ref but forget inode_extref case. Let btrfs_unlink() call btrfs_lookup_inode_extref() if inode_ref is found and EXTENDED_IREF feature is enabled. Fixes: 0cc75eddd093 ("btrfs-progs: Add btrfs_unlink() and btrfs_add_link()

[PATCH v2 4/7] btrfs-progs: lowmem: search key of root again after check_fs_root() under repair

2018-09-12 Thread damenly . su
From: Su Yue In check_fs_roots_lowmem(), we do search and follow the resulted path to call check_fs_root(), then call btrfs_next_item() to check next root. However, if repair is enabled, the root tree can be cowed, the existed path can cause strange errors. Solution: If repair, save the key be

[PATCH v2 1/7] btrfs-progs: adjust arguments of btrfs_lookup_inode_extref()

2018-09-12 Thread damenly . su
From: Su Yue The argument index is not used in btrfs_lookup_inode_extref(), so remove it. And adjust positions its arguments to make it consistent with kernel part. No functional change. Fixes: 260675657767 ("btrfs-progs: Import btrfs_insert/del/lookup_extref() functions.") Signed-off-by: Su Y

[PATCH v2 3/7] btrfs-progs: lowmem check: find dir_item by di_key in check_dir_item()

2018-09-12 Thread damenly . su
From: Su Yue In check_dir_item, we are going to search corresponding dir_item/index. Commit 564901eac7a4 ("btrfs-progs: check: introduce print_dir_item_err()") Changed argument name from key to di_key but forgot to change the key name for dir_item search. So @key shouldn't be used here. It shoul

[PATCH 5/7] btrfs-progs: lowmem: improve check_inode_extref()

2018-09-12 Thread damenly . su
From: Su Yue inode_extref is much similar with inode_ref, most codes are reused in check_inode_extref(). Exception: There is no need to check root directory, so remove it. Make check_inode_extref() verify hash value with key offset now. And lowmem check can detect errors about inode_extref and t

[PATCH 5/6] btrfs-progs: lowmem: continue to check item in last slot while checking inodes

2018-09-12 Thread damenly . su
From: Su Yue After call of check_inode_item(), path may point to the last unchecked slot of the leaf. The outer walk_up_tree() always treats the position as checked item then skips to next item. If the last item was an inode item, yes, it was unchecked. Then walk_up_tree() will think the leaf is

[PATCH 6/7] btrfs-progs: lowmem: continue to check item in last slot while checking inodes

2018-09-12 Thread damenly . su
From: Su Yue After call of check_inode_item(), path may point to the last unchecked slot of the leaf. The outer walk_up_tree() always treats the position as checked item then skips to next item. If the last item was an inode item, yes, it was unchecked. Then walk_up_tree() will think the leaf is

[PATCH 7/7] btrfs-progs: fsck-tests: add test case inode_extref without dir_item and dir_index

2018-09-12 Thread damenly . su
From: Su Yue This case contains an inode_extref: == ... item 1 key (257 INODE_EXTREF 3460996356) itemoff 3947 itemsize 24 index 257 parent 256 namelen 6 name: foo255 ... == The related dir_item and

[PATCH 6/6] btrfs-progs: lowmem: optimization and repair for check_inode_extref()

2018-09-12 Thread damenly . su
From: Su Yue inode_extref is much similar with inode_ref, most codes are reused in check_inode_extref(). Exception: There is no need to check root directory, so remove it. Make check_inode_extref() verify hash value with key offset now. And lowmem check can detect errors about inode_extref and t

[PATCH 4/6] btrfs-progs: lowmem: search key of root again after check_fs_root() under repair

2018-09-12 Thread damenly . su
From: Su Yue In check_fs_roots_lowmem(), we do search and follow the resulted path to call check_fs_root(), then call btrfs_next_item() to check next root. However, if repair is enabled, the root tree can be cowed, the existed path can cause strange errors. Solution: If repair, save the key be

[PATCH 2/6] btrfs-progs: make btrfs_unlink() lookup inode_extref

2018-09-12 Thread damenly . su
From: Su Yue btrfs_unlink() uses btrfs_lookup_inode_ref() to look up inode_ref but forget inode_extref case. Let btrfs_unlink() call btrfs_lookup_inode_extref() if inode_ref is found and EXTENDED_IREF feature is enabled. Fixes: 0cc75eddd093 ("btrfs-progs: Add btrfs_unlink() and btrfs_add_link()

[PATCH 1/6] btrfs-progs: adjust arguments of btrfs_lookup_inode_extref()

2018-09-12 Thread damenly . su
From: Su Yue The argument index is not used in btrfs_lookup_inode_extref(), so remove it. And adjust positions its arguments to make it consistent with kernel part. No functional change. Fixes: 260675657767 ("btrfs-progs: Import btrfs_insert/del/lookup_extref() functions.") Signed-off-by: Su Y

[PATCH 3/6] btrfs-progs: lowmem check: find dir_item by di_key in check_dir_item()

2018-09-12 Thread damenly . su
From: Su Yue In check_dir_item, we are going to search corresponding dir_item/index. Commit 564901eac7a4 ("btrfs-progs: check: introduce print_dir_item_err()") Changed argument name from key to di_key but forgot to change the key name for dir_item search. So @key shouldn't be used here. It shoul

[PATCH 0/6] btrfs-progs: lowmem: bug fixes and inode_extref repair

2018-09-12 Thread damenly . su
From: Su Yue This patchset can be fetched from my github(based on v4.17.1): https://github.com/Damenly/btrfs-progs/tree/lowmem_extref The patchset aims to support check and repair errors about inode_extref in lowmem mode. patch[1-2] let btrfs_unlink() detect inode_extref. patch[3] fixes a

[PATCH 2/2] btrfs-progs: task: add init_ctx and clean up arguments of task_start()

2018-08-21 Thread damenly . su
From: Su Yue Add a function init_ctx() to initialize time and count of ctx while checking. Use it as prefn while calling task_init(). Arguments start_time and item_count of task_start() are useless, remove them. Signed-off-by: Su Yue --- check/main.c | 26 ++ convert/

[PATCH 1/2] btrfs-progs: task: add prefn() into struct task_info

2018-08-21 Thread damenly . su
From: Su Yue Previously, everytime task_start is called, arguments to be initialized (start_time and item_count) are passed manually. For scalability, add a member prefn() to struct task_info. prefn() will be called before pthread_create() in task_start(). Signed-off-by: Su Yue --- check/main

[PATCH 0/2] btrfs-progs: task: add prefn() to task_info and simplify task_start()

2018-08-21 Thread damenly . su
From: Su Yue This patchset is a prepare work for further process of check. patch[1] adds prefn() to task_info and call it before pthread_create(). patch[2] moves time and count initializations into the new init_ctx(), assign it to prefun(). Remove arguments start_time and item_count. Su Yue (

Re: [PATCH] btrfs-progs: let mkfs return nozero value on thin provision device

2018-04-09 Thread Damenly Su
Sorry for the previous reply in HTML format which is not delivered to the mail list. I mean there is already xfstests generic/405 for the situation. Thin provision devices need to call dmsetup to setup. I wonder If calling dmsetup in progs tests is acceptable or not. If it is, I will do it. Thank