mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-12-04 01:24:20 +08:00
eacdd1606c
[BUG] Commit ("btrfs-progs: use raid table for profile names in print-tree.c") introduced one bug in block group and chunk flags output and changed the behavior: item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 13631488) itemoff 16105 itemsize 80 length 8388608 owner 2 stripe_len 65536 type SINGLE ... item 2 key (FIRST_CHUNK_TREE CHUNK_ITEM 22020096) itemoff 15993 itemsize 112 length 8388608 owner 2 stripe_len 65536 type DUP ... item 3 key (FIRST_CHUNK_TREE CHUNK_ITEM 30408704) itemoff 15881 itemsize 112 length 268435456 owner 2 stripe_len 65536 type DUP ... Note that, the flag string only contains the profile (SINGLE/DUP/etc...) no type (DATA/METADATA/SYSTEM). And we have new "SINGLE" string, even that profile has no extra bit to indicate that. [CAUSE] The "SINGLE" part is caused by the raid array which has a name for SINGLE profile, even it doesn't have the corresponding bit. The missing type string is caused by a code bug: strcpy(buf, name); while (*tmp) { *tmp = toupper(*tmp); tmp++; } strcpy(ret, buf); The last strcpy() call overrides the existing string in @ret. [FIX] - Enhance string handling using strn*()/snprintf() - Add extra "UKNOWN.0x%llx" output for unknown profiles - Call proper strncat() to merge type and profile - Add extra handling for "SINGLE" to keep the old output Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
backref.c | ||
backref.h | ||
ctree.c | ||
ctree.h | ||
delayed-ref.c | ||
delayed-ref.h | ||
dir-item.c | ||
disk-io.c | ||
disk-io.h | ||
extent_io.c | ||
extent_io.h | ||
extent-tree.c | ||
file-item.c | ||
file.c | ||
free-space-cache.c | ||
free-space-cache.h | ||
free-space-tree.c | ||
free-space-tree.h | ||
inode-item.c | ||
inode.c | ||
print-tree.c | ||
print-tree.h | ||
root-tree.c | ||
send.h | ||
transaction.c | ||
transaction.h | ||
ulist.c | ||
ulist.h | ||
uuid-tree.c | ||
volumes.c | ||
volumes.h | ||
zoned.c | ||
zoned.h |