All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared
@ 2023-04-19 21:13 Josef Bacik
  2023-04-19 21:13 ` [PATCH 01/11] btrfs-progs: fix kerncompat.h include ordering for libbtrfs Josef Bacik
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Hello,

These a variety of fixes, cleanups, and api changes to make it easier to sync
recent kernel changes into btrfs-progs.  They're relatively straightforward, and
have been run through the tests.  Thanks,

Josef

Josef Bacik (11):
  btrfs-progs: fix kerncompat.h include ordering for libbtrfs
  btrfs-progs: use $SUDO_HELPER in convert tests for temp files
  btrfs-progs: re-add __init to include/kerncompat.h
  btrfs-progs: introduce UASSERT() for purely userspace code
  btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace
  btrfs-progs: remove the _on() related message helpers
  btrfs-progs: consolidate the btrfs message helpers
  btrfs-progs: rename the qgroup structs to match the kernel
  btrfs-progs: remove fs_info argument from btrfs_check_* helpers
  btrfs-progs: add a btrfs check helper for checking blocks
  btrfs-progs: remove parent_key arg from btrfs_check_* helpers

 check/clear-cache.c         |  4 +-
 check/main.c                | 26 ++++-------
 check/mode-common.c         | 12 ++---
 check/mode-lowmem.c         | 31 ++++++-------
 check/qgroup-verify.c       | 16 +++----
 check/repair.c              | 29 ++++++++++++
 check/repair.h              |  3 +-
 cmds/filesystem-du.c        |  2 +-
 cmds/filesystem-usage.c     |  6 +--
 cmds/qgroup.c               | 42 ++++++++----------
 cmds/replace.c              |  4 +-
 cmds/rescue-chunk-recover.c |  6 +--
 cmds/rescue.c               |  4 +-
 cmds/subvolume-list.c       | 20 ++++-----
 common/device-utils.c       |  4 +-
 common/messages.c           | 69 +----------------------------
 common/messages.h           | 56 ++++++++++++++---------
 common/units.c              |  4 +-
 convert/common.c            |  4 +-
 convert/main.c              |  2 +-
 image/main.c                |  2 +-
 include/kerncompat.h        | 14 ++----
 kernel-shared/ctree.c       | 43 ++++--------------
 kernel-shared/ctree.h       | 88 ++++++++++++++++++-------------------
 kernel-shared/disk-io.c     |  4 +-
 kernel-shared/print-tree.c  | 18 ++++----
 libbtrfs/ctree.h            |  4 +-
 libbtrfs/send-stream.c      |  3 +-
 libbtrfs/send-utils.c       |  2 +-
 mkfs/main.c                 |  4 +-
 tests/common.convert        | 16 +++----
 31 files changed, 231 insertions(+), 311 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 01/11] btrfs-progs: fix kerncompat.h include ordering for libbtrfs
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 02/11] btrfs-progs: use $SUDO_HELPER in convert tests for temp files Josef Bacik
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

We're keeping a libbtrfs compatible kerncompat.h around to make it
easier to modify the rest of btrfs-progs.  Unfortunately we also use
some of kernel-lib in libbtrfs, and those also include kerncompat.h.
Those getting included first means we'll pull include/kerncompat.h
instead of libbtrfs/kerncompat.h, which will mess things up.

Fix this by making sure we include our local copy of kerncompat.h first
before we include any other header in btrfs-progs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 libbtrfs/ctree.h      | 4 ++--
 libbtrfs/send-utils.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libbtrfs/ctree.h b/libbtrfs/ctree.h
index e7a51c4b..ea2a680e 100644
--- a/libbtrfs/ctree.h
+++ b/libbtrfs/ctree.h
@@ -22,14 +22,14 @@
 #include <stdbool.h>
 
 #if BTRFS_FLAT_INCLUDES
+#include "libbtrfs/kerncompat.h"
 #include "kernel-lib/list.h"
 #include "kernel-lib/rbtree.h"
-#include "libbtrfs/kerncompat.h"
 #include "libbtrfs/ioctl.h"
 #else
+#include <btrfs/kerncompat.h>
 #include <btrfs/list.h>
 #include <btrfs/rbtree.h>
-#include <btrfs/kerncompat.h>
 #include <btrfs/ioctl.h>
 #endif /* BTRFS_FLAT_INCLUDES */
 
diff --git a/libbtrfs/send-utils.c b/libbtrfs/send-utils.c
index 831ec0dc..eb0ed5af 100644
--- a/libbtrfs/send-utils.c
+++ b/libbtrfs/send-utils.c
@@ -24,10 +24,10 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <errno.h>
-#include "kernel-lib/rbtree.h"
 #include "libbtrfs/ctree.h"
 #include "libbtrfs/send-utils.h"
 #include "libbtrfs/ioctl.h"
+#include "kernel-lib/rbtree.h"
 
 static int btrfs_subvolid_resolve_sub(int fd, char *path, size_t *path_len,
 				      u64 subvol_id);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 02/11] btrfs-progs: use $SUDO_HELPER in convert tests for temp files
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
  2023-04-19 21:13 ` [PATCH 01/11] btrfs-progs: fix kerncompat.h include ordering for libbtrfs Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 03/11] btrfs-progs: re-add __init to include/kerncompat.h Josef Bacik
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

While running make test-convert as a normal user I ran into this problem
where we do sudo find <blah> into a mktemp file that's created as the
normal user.  This results in find getting a EPERM while trying to mess
with that temp file.  Fix this by using $SUDO_HELPER for all the
tempfile manipulations so that root is the owner of everything, which
allows the convert tests to run as a normal user.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/common.convert | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/common.convert b/tests/common.convert
index 264972fa..160909eb 100644
--- a/tests/common.convert
+++ b/tests/common.convert
@@ -113,32 +113,32 @@ convert_test_perm() {
 
 	_assert_path "$1"
 	PERMTMP="$1"
-	FILES_LIST=$(mktemp --tmpdir btrfs-progs-convert-filelist.XXXXXX)
+	FILES_LIST=$($SUDO_HELPER mktemp --tmpdir btrfs-progs-convert-filelist.XXXXXX)
 
 	run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/test" "bs=$nodesize" \
 		count=1 status=noxfer >/dev/null 2>&1
 	run_check_stdout $SUDO_HELPER find "$TEST_MNT" -type f ! -name 'image' -fprint "$FILES_LIST"
 	# Fix directory entries order
-	sort "$FILES_LIST" -o "$FILES_LIST"
-	for file in `cat "$FILES_LIST"` ;do
+	$SUDO_HELPER sort "$FILES_LIST" -o "$FILES_LIST"
+	for file in `$SUDO_HELPER cat "$FILES_LIST"` ;do
 		run_check_stdout $SUDO_HELPER getfacl --absolute-names "$file" >> "$PERMTMP"
 	done
-	rm -- "$FILES_LIST"
+	$SUDO_HELPER rm -- "$FILES_LIST"
 }
 # list acls of files on $TEST_MNT
 # $1: path where the acls will be stored
 convert_test_acl() {
 	local ACLSTMP
 	ACLTMP="$1"
-	FILES_LIST=$(mktemp --tmpdir btrfs-progs-convert-filelist.XXXXXX)
+	FILES_LIST=$($SUDO_HELPER mktemp --tmpdir btrfs-progs-convert-filelist.XXXXXX)
 
 	run_check_stdout $SUDO_HELPER find "$TEST_MNT/acls" -type f -fprint "$FILES_LIST"
 	# Fix directory entries order
-	sort "$FILES_LIST" -o "$FILES_LIST"
-	for file in `cat "$FILES_LIST"`;do
+	$SUDO_HELPER sort "$FILES_LIST" -o "$FILES_LIST"
+	for file in `$SUDO_HELPER cat "$FILES_LIST"`;do
 		run_check_stdout $SUDO_HELPER getfattr --absolute-names -d "$file" >> "$ACLTMP"
 	done
-	rm -- "$FILES_LIST"
+	$SUDO_HELPER rm -- "$FILES_LIST"
 }
 
 # do conversion with given features and nodesize, fsck afterwards
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 03/11] btrfs-progs: re-add __init to include/kerncompat.h
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
  2023-04-19 21:13 ` [PATCH 01/11] btrfs-progs: fix kerncompat.h include ordering for libbtrfs Josef Bacik
  2023-04-19 21:13 ` [PATCH 02/11] btrfs-progs: use $SUDO_HELPER in convert tests for temp files Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 04/11] btrfs-progs: introduce UASSERT() for purely userspace code Josef Bacik
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Now that we're properly separated with libbtrfs/kerncompat.h and
include/kerncompat.h, go ahead and add the __init definition back so we
can have it available for the kernel synced files.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 include/kerncompat.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/kerncompat.h b/include/kerncompat.h
index 4dce65c0..62b6a357 100644
--- a/include/kerncompat.h
+++ b/include/kerncompat.h
@@ -578,11 +578,7 @@ struct work_struct {
 typedef struct wait_queue_head_s {
 } wait_queue_head_t;
 
-/*
- * __init cannot be defined in kerncompat.h as it's still part of libbtrfs and
- * the macro name is too generic and can break build.
 #define __init
-*/
 #define __cold
 
 #endif
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 04/11] btrfs-progs: introduce UASSERT() for purely userspace code
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (2 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 03/11] btrfs-progs: re-add __init to include/kerncompat.h Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 05/11] btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace Josef Bacik
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

While syncing messages.[ch] I had to back out the ASSERT() code in
kerncompat.h, which means we now rely on the kernel code for ASSERT().
In order to maintain some semblance of separation introduce UASSERT()
and use that in all the purely userspace code.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/clear-cache.c         |  4 ++--
 check/main.c                | 10 +++++-----
 check/mode-common.c         | 12 ++++++------
 check/mode-lowmem.c         | 20 ++++++++++----------
 cmds/filesystem-du.c        |  2 +-
 cmds/filesystem-usage.c     |  6 +++---
 cmds/qgroup.c               | 22 +++++++++++-----------
 cmds/replace.c              |  4 ++--
 cmds/rescue-chunk-recover.c |  6 +++---
 cmds/rescue.c               |  4 ++--
 cmds/subvolume-list.c       | 20 ++++++++++----------
 common/device-utils.c       |  4 ++--
 common/messages.h           |  6 ++++++
 common/units.c              |  4 ++--
 convert/common.c            |  4 ++--
 convert/main.c              |  2 +-
 image/main.c                |  2 +-
 libbtrfs/send-stream.c      |  3 ++-
 mkfs/main.c                 |  4 ++--
 19 files changed, 73 insertions(+), 66 deletions(-)

diff --git a/check/clear-cache.c b/check/clear-cache.c
index 0a3001a4..ecc95167 100644
--- a/check/clear-cache.c
+++ b/check/clear-cache.c
@@ -505,12 +505,12 @@ int truncate_free_ino_items(struct btrfs_root *root)
 			fi = btrfs_item_ptr(leaf, path.slots[0],
 					    struct btrfs_file_extent_item);
 			extent_type = btrfs_file_extent_type(leaf, fi);
-			ASSERT(extent_type == BTRFS_FILE_EXTENT_REG);
+			UASSERT(extent_type == BTRFS_FILE_EXTENT_REG);
 			extent_disk_bytenr = btrfs_file_extent_disk_bytenr(leaf, fi);
 			extent_num_bytes = btrfs_file_extent_disk_num_bytes (leaf, fi);
 			extent_offset = found_key.offset -
 					btrfs_file_extent_offset(leaf, fi);
-			ASSERT(extent_offset == 0);
+			UASSERT(extent_offset == 0);
 			ret = btrfs_free_extent(trans, root, extent_disk_bytenr,
 						extent_num_bytes, 0, root->objectid,
 						BTRFS_FREE_INO_OBJECTID, 0);
diff --git a/check/main.c b/check/main.c
index 9a7f40e7..1a9ad50c 100644
--- a/check/main.c
+++ b/check/main.c
@@ -9680,14 +9680,14 @@ static int build_roots_info_cache(void)
 			rii->level = (u8)-1;
 			entry = &rii->cache_extent;
 			ret = insert_cache_extent(roots_info_cache, entry);
-			ASSERT(ret == 0);
+			UASSERT(ret == 0);
 		} else {
 			rii = container_of(entry, struct root_item_info,
 					   cache_extent);
 		}
 
-		ASSERT(rii->cache_extent.start == root_id);
-		ASSERT(rii->cache_extent.size == 1);
+		UASSERT(rii->cache_extent.start == root_id);
+		UASSERT(rii->cache_extent.size == 1);
 
 		if (level > rii->level || rii->level == (u8)-1) {
 			rii->level = level;
@@ -9726,8 +9726,8 @@ static int maybe_repair_root_item(struct btrfs_path *path,
 	}
 
 	rii = container_of(entry, struct root_item_info, cache_extent);
-	ASSERT(rii->cache_extent.start == root_id);
-	ASSERT(rii->cache_extent.size == 1);
+	UASSERT(rii->cache_extent.start == root_id);
+	UASSERT(rii->cache_extent.size == 1);
 
 	if (rii->node_count != 1) {
 		fprintf(stderr,
diff --git a/check/mode-common.c b/check/mode-common.c
index c8ac235d..ef272368 100644
--- a/check/mode-common.c
+++ b/check/mode-common.c
@@ -224,8 +224,8 @@ int check_prealloc_extent_written(u64 disk_bytenr, u64 num_bytes)
 
 		iref = (struct btrfs_extent_inline_ref *)ptr;
 		type = btrfs_extent_inline_ref_type(path.nodes[0], iref);
-		ASSERT(type == BTRFS_EXTENT_DATA_REF_KEY ||
-		       type == BTRFS_SHARED_DATA_REF_KEY);
+		UASSERT(type == BTRFS_EXTENT_DATA_REF_KEY ||
+			type == BTRFS_SHARED_DATA_REF_KEY);
 
 		if (type == BTRFS_EXTENT_DATA_REF_KEY) {
 			struct btrfs_extent_data_ref *dref;
@@ -398,7 +398,7 @@ int insert_inode_item(struct btrfs_trans_handle *trans,
 	btrfs_set_stack_timespec_sec(&ii.mtime, now);
 
 	ret = btrfs_insert_inode(trans, root, ino, &ii);
-	ASSERT(!ret);
+	UASSERT(!ret);
 
 	warning("root %llu inode %llu recreating inode item, this may "
 		"be incomplete, please check permissions and content after "
@@ -985,7 +985,7 @@ int repair_imode_common(struct btrfs_root *root, struct btrfs_path *path)
 	int ret;
 
 	btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
-	ASSERT(key.type == BTRFS_INODE_ITEM_KEY);
+	UASSERT(key.type == BTRFS_INODE_ITEM_KEY);
 	if (root->objectid == BTRFS_ROOT_TREE_OBJECTID) {
 		/* In root tree we only have two possible imode */
 		if (key.objectid == BTRFS_ROOT_TREE_OBJECTID)
@@ -1033,7 +1033,7 @@ int check_repair_free_space_inode(struct btrfs_path *path)
 	int ret = 0;
 
 	btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
-	ASSERT(key.type == BTRFS_INODE_ITEM_KEY && is_fstree(key.objectid));
+	UASSERT(key.type == BTRFS_INODE_ITEM_KEY && is_fstree(key.objectid));
 	iitem = btrfs_item_ptr(path->nodes[0], path->slots[0],
 			       struct btrfs_inode_item);
 	mode = btrfs_inode_mode(path->nodes[0], iitem);
@@ -1607,7 +1607,7 @@ static int get_num_devs_in_chunk_tree(struct btrfs_fs_info *fs_info)
 		return ret;
 
 	/* We should be the first slot, and chunk tree should not be empty*/
-	ASSERT(path.slots[0] == 0 && btrfs_header_nritems(path.nodes[0]));
+	UASSERT(path.slots[0] == 0 && btrfs_header_nritems(path.nodes[0]));
 
 	btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
 
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 10258d34..f0e5f8d6 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -833,7 +833,7 @@ static int find_dir_index(struct btrfs_root *root, u64 dirid, u64 location_id,
 	int slot;
 	int ret;
 
-	ASSERT(index_ret);
+	UASSERT(index_ret);
 
 	/* search from the last index */
 	key.objectid = dirid;
@@ -1029,7 +1029,7 @@ static int repair_ternary_lowmem(struct btrfs_root *root, u64 dir_ino, u64 ino,
 		stage++;
 
 	/* stage must be smllarer than 3 */
-	ASSERT(stage < 3);
+	UASSERT(stage < 3);
 
 	trans = btrfs_start_transaction(root, 1);
 	if (stage == 2) {
@@ -1351,7 +1351,7 @@ static int find_inode_ref(struct btrfs_root *root, struct btrfs_key *key,
 	int slot;
 	int ret;
 
-	ASSERT(index_ret);
+	UASSERT(index_ret);
 
 	btrfs_init_path(&path);
 	ret = btrfs_search_slot(NULL, root, key, &path, 0, 0);
@@ -1945,7 +1945,7 @@ recover:
 	recover_ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
 
 	/* This really shouldn't happen, or we have a big problem */
-	ASSERT(recover_ret == 0);
+	UASSERT(recover_ret == 0);
 	return ret;
 }
 
@@ -2193,7 +2193,7 @@ static int __count_dir_isize(struct btrfs_root *root, u64 ino, int type,
 	int cur = 0;
 	int total = 0;
 
-	ASSERT(size_ret);
+	UASSERT(size_ret);
 	*size_ret = 0;
 
 	key.objectid = ino;
@@ -2247,7 +2247,7 @@ static int count_dir_isize(struct btrfs_root *root, u64 ino, u64 *size)
 	u64 index_size;
 	int ret;
 
-	ASSERT(size);
+	UASSERT(size);
 	ret = __count_dir_isize(root, ino, BTRFS_DIR_ITEM_KEY, &item_size);
 	if (ret)
 		goto out;
@@ -2451,7 +2451,7 @@ static int repair_inode_nlinks_lowmem(struct btrfs_root *root,
 	btrfs_item_key_to_cpu(path->nodes[0], &old_key, path->slots[0]);
 
 	if (name && namelen) {
-		ASSERT(namelen <= BTRFS_NAME_LEN);
+		UASSERT(namelen <= BTRFS_NAME_LEN);
 		memcpy(namebuf, name, namelen);
 		name_len = namelen;
 	} else {
@@ -2550,7 +2550,7 @@ static int repair_inode_gen_lowmem(struct btrfs_root *root,
 	}
 	transid = trans->transid;
 	btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
-	ASSERT(key.type == BTRFS_INODE_ITEM_KEY);
+	UASSERT(key.type == BTRFS_INODE_ITEM_KEY);
 
 	btrfs_release_path(path);
 
@@ -4188,8 +4188,8 @@ static int repair_extent_item_generation(struct btrfs_path *path)
 	int ret;
 
 	btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
-	ASSERT(key.type == BTRFS_METADATA_ITEM_KEY ||
-	       key.type == BTRFS_EXTENT_ITEM_KEY);
+	UASSERT(key.type == BTRFS_METADATA_ITEM_KEY ||
+		key.type == BTRFS_EXTENT_ITEM_KEY);
 
 	get_extent_item_generation(key.objectid, &new_gen);
 	ret = avoid_extents_overwrite();
diff --git a/cmds/filesystem-du.c b/cmds/filesystem-du.c
index 0e1210e0..33b6d901 100644
--- a/cmds/filesystem-du.c
+++ b/cmds/filesystem-du.c
@@ -87,7 +87,7 @@ static int add_shared_extent(u64 start, u64 len, struct rb_root *root)
 {
 	struct shared_extent *sh;
 
-	ASSERT(len != 0);
+	UASSERT(len != 0);
 
 	sh = calloc(1, sizeof(*sh));
 	if (!sh)
diff --git a/cmds/filesystem-usage.c b/cmds/filesystem-usage.c
index e483c104..d1e7eed1 100644
--- a/cmds/filesystem-usage.c
+++ b/cmds/filesystem-usage.c
@@ -383,15 +383,15 @@ static void get_raid56_space_info(struct btrfs_ioctl_space_args *sargs,
 		size = info_ptr->size / (info_ptr->num_stripes - parities_count);
 
 		if (info_ptr->type & BTRFS_BLOCK_GROUP_DATA) {
-			ASSERT(l_data_ratio >= 0);
+			UASSERT(l_data_ratio >= 0);
 			*r_data_chunks += size;
 			*r_data_used += size * l_data_ratio;
 		} else if (info_ptr->type & BTRFS_BLOCK_GROUP_METADATA) {
-			ASSERT(l_metadata_ratio >= 0);
+			UASSERT(l_metadata_ratio >= 0);
 			*r_metadata_chunks += size;
 			*r_metadata_used += size * l_metadata_ratio;
 		} else if (info_ptr->type & BTRFS_BLOCK_GROUP_SYSTEM) {
-			ASSERT(l_system_ratio >= 0);
+			UASSERT(l_system_ratio >= 0);
 			*r_system_chunks += size;
 			*r_system_used += size * l_system_ratio;
 		}
diff --git a/cmds/qgroup.c b/cmds/qgroup.c
index 49014d57..125362b8 100644
--- a/cmds/qgroup.c
+++ b/cmds/qgroup.c
@@ -222,7 +222,7 @@ static void qgroup_setup_print_column(enum btrfs_qgroup_column_enum column)
 {
 	int i;
 
-	ASSERT(0 <= column && column <= BTRFS_QGROUP_ALL);
+	UASSERT(0 <= column && column <= BTRFS_QGROUP_ALL);
 
 	if (column < BTRFS_QGROUP_ALL) {
 		btrfs_qgroup_columns[column].need_print = 1;
@@ -332,7 +332,7 @@ static void print_qgroup_column(struct btrfs_qgroup *qgroup,
 	int unit_mode = btrfs_qgroup_columns[column].unit_mode;
 	int max_len = btrfs_qgroup_columns[column].max_len;
 
-	ASSERT(0 <= column && column < BTRFS_QGROUP_ALL);
+	UASSERT(0 <= column && column < BTRFS_QGROUP_ALL);
 
 	switch (column) {
 
@@ -617,9 +617,9 @@ static int qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set,
 	struct btrfs_qgroup_comparer_set *set = *comp_set;
 	int size;
 
-	ASSERT(set != NULL);
-	ASSERT(comparer < BTRFS_QGROUP_COMP_MAX);
-	ASSERT(set->ncomps <= set->total);
+	UASSERT(set != NULL);
+	UASSERT(comparer < BTRFS_QGROUP_COMP_MAX);
+	UASSERT(set->ncomps <= set->total);
 
 	if (set->ncomps == set->total) {
 		void *tmp;
@@ -641,7 +641,7 @@ static int qgroup_setup_comparer(struct btrfs_qgroup_comparer_set **comp_set,
 		*comp_set = set;
 	}
 
-	ASSERT(set->comps[set->ncomps].comp_func == NULL);
+	UASSERT(set->comps[set->ncomps].comp_func == NULL);
 
 	set->comps[set->ncomps].comp_func = all_comp_funcs[comparer];
 	set->comps[set->ncomps].is_descending = is_descending;
@@ -1014,9 +1014,9 @@ static int qgroup_setup_filter(struct btrfs_qgroup_filter_set **filter_set,
 	struct btrfs_qgroup_filter_set *set = *filter_set;
 	int size;
 
-	ASSERT(set != NULL);
-	ASSERT(filter < BTRFS_QGROUP_FILTER_MAX);
-	ASSERT(set->nfilters <= set->total);
+	UASSERT(set != NULL);
+	UASSERT(filter < BTRFS_QGROUP_FILTER_MAX);
+	UASSERT(set->nfilters <= set->total);
 
 	if (set->nfilters == set->total) {
 		void *tmp;
@@ -1038,7 +1038,7 @@ static int qgroup_setup_filter(struct btrfs_qgroup_filter_set **filter_set,
 		*filter_set = set;
 	}
 
-	ASSERT(set->filters[set->nfilters].filter_func == NULL);
+	UASSERT(set->filters[set->nfilters].filter_func == NULL);
 	set->filters[set->nfilters].filter_func = all_filter_funcs[filter];
 	set->filters[set->nfilters].data = data;
 	set->nfilters++;
@@ -1114,7 +1114,7 @@ static void __update_columns_max_len(struct btrfs_qgroup *bq,
 	int len;
 	unsigned unit_mode = btrfs_qgroup_columns[column].unit_mode;
 
-	ASSERT(0 <= column && column < BTRFS_QGROUP_ALL);
+	UASSERT(0 <= column && column < BTRFS_QGROUP_ALL);
 
 	switch (column) {
 
diff --git a/cmds/replace.c b/cmds/replace.c
index ad914306..2748b7fb 100644
--- a/cmds/replace.c
+++ b/cmds/replace.c
@@ -519,7 +519,7 @@ time2string(char *buf, size_t s, __u64 t)
 	time_t t_time_t;
 
 	t_time_t = (time_t)t;
-	ASSERT((__u64)t_time_t == t);
+	UASSERT((__u64)t_time_t == t);
 	localtime_r(&t_time_t, &t_tm);
 	strftime(buf, s, "%e.%b %T", &t_tm);
 	return buf;
@@ -529,7 +529,7 @@ static char *
 progress2string(char *buf, size_t s, int progress_1000)
 {
 	snprintf(buf, s, "%d.%01d%%", progress_1000 / 10, progress_1000 % 10);
-	ASSERT(s > 0);
+	UASSERT(s > 0);
 	buf[s - 1] = '\0';
 	return buf;
 }
diff --git a/cmds/rescue-chunk-recover.c b/cmds/rescue-chunk-recover.c
index 500509fd..6a1b6734 100644
--- a/cmds/rescue-chunk-recover.c
+++ b/cmds/rescue-chunk-recover.c
@@ -1455,7 +1455,7 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
 		goto out_devices;
 	}
 
-	ASSERT(!memcmp(disk_super->fsid, rc->fs_devices->fsid, BTRFS_FSID_SIZE));
+	UASSERT(!memcmp(disk_super->fsid, rc->fs_devices->fsid, BTRFS_FSID_SIZE));
 	fs_info->sectorsize = btrfs_super_sectorsize(disk_super);
 	fs_info->nodesize = btrfs_super_nodesize(disk_super);
 	fs_info->stripesize = btrfs_super_stripesize(disk_super);
@@ -1467,7 +1467,7 @@ open_ctree_with_broken_chunk(struct recover_control *rc)
 	features = btrfs_super_incompat_flags(disk_super);
 
 	if (features & BTRFS_FEATURE_INCOMPAT_METADATA_UUID)
-		ASSERT(!memcmp(disk_super->metadata_uuid,
+		UASSERT(!memcmp(disk_super->metadata_uuid,
 			       fs_info->fs_devices->metadata_uuid,
 			       BTRFS_FSID_SIZE));
 
@@ -1869,7 +1869,7 @@ static int check_one_csum(int fd, u64 start, u32 len, u32 tree_csum,
 	int csum_size = 0;
 	u8 expected_csum[BTRFS_CSUM_SIZE];
 
-	ASSERT(0);
+	UASSERT(0);
 
 	data = malloc(len);
 	if (!data)
diff --git a/cmds/rescue.c b/cmds/rescue.c
index 28a54a65..cbeaa6f2 100644
--- a/cmds/rescue.c
+++ b/cmds/rescue.c
@@ -322,8 +322,8 @@ static int clear_uuid_tree(struct btrfs_fs_info *fs_info)
 		ret = btrfs_search_slot(trans, uuid_root, &key, &path, -1, 1);
 		if (ret < 0)
 			goto out;
-		ASSERT(ret > 0);
-		ASSERT(path.slots[0] == 0);
+		UASSERT(ret > 0);
+		UASSERT(path.slots[0] == 0);
 
 		nr = btrfs_header_nritems(path.nodes[0]);
 		if (nr == 0) {
diff --git a/cmds/subvolume-list.c b/cmds/subvolume-list.c
index 750fc4e6..e0a7b339 100644
--- a/cmds/subvolume-list.c
+++ b/cmds/subvolume-list.c
@@ -284,7 +284,7 @@ void btrfs_list_setup_print_column(enum btrfs_list_column_enum column)
 {
 	int i;
 
-	ASSERT(0 <= column && column <= BTRFS_LIST_ALL);
+	UASSERT(0 <= column && column <= BTRFS_LIST_ALL);
 
 	if (column < BTRFS_LIST_ALL) {
 		btrfs_list_columns[column].need_print = 1;
@@ -367,9 +367,9 @@ static int btrfs_list_setup_comparer(struct btrfs_list_comparer_set **comp_set,
 	struct btrfs_list_comparer_set *set = *comp_set;
 	int size;
 
-	ASSERT(set != NULL);
-	ASSERT(comparer < BTRFS_LIST_COMP_MAX);
-	ASSERT(set->ncomps <= set->total);
+	UASSERT(set != NULL);
+	UASSERT(comparer < BTRFS_LIST_COMP_MAX);
+	UASSERT(set->ncomps <= set->total);
 
 	if (set->ncomps == set->total) {
 		void *tmp;
@@ -391,7 +391,7 @@ static int btrfs_list_setup_comparer(struct btrfs_list_comparer_set **comp_set,
 		*comp_set = set;
 	}
 
-	ASSERT(set->comps[set->ncomps].comp_func == NULL);
+	UASSERT(set->comps[set->ncomps].comp_func == NULL);
 
 	set->comps[set->ncomps].comp_func = all_comp_funcs[comparer];
 	set->comps[set->ncomps].is_descending = is_descending;
@@ -1027,9 +1027,9 @@ static void btrfs_list_setup_filter(struct btrfs_list_filter_set **filter_set,
 	struct btrfs_list_filter_set *set = *filter_set;
 	int size;
 
-	ASSERT(set != NULL);
-	ASSERT(filter < BTRFS_LIST_FILTER_MAX);
-	ASSERT(set->nfilters <= set->total);
+	UASSERT(set != NULL);
+	UASSERT(filter < BTRFS_LIST_FILTER_MAX);
+	UASSERT(set->nfilters <= set->total);
 
 	if (set->nfilters == set->total) {
 		void *tmp;
@@ -1051,7 +1051,7 @@ static void btrfs_list_setup_filter(struct btrfs_list_filter_set **filter_set,
 		*filter_set = set;
 	}
 
-	ASSERT(set->filters[set->nfilters].filter_func == NULL);
+	UASSERT(set->filters[set->nfilters].filter_func == NULL);
 
 	if (filter == BTRFS_LIST_FILTER_DELETED)
 		set->only_deleted = 1;
@@ -1129,7 +1129,7 @@ static void print_subvolume_column(struct root_info *subv,
 	char tstr[256];
 	char uuidparse[BTRFS_UUID_UNPARSED_SIZE];
 
-	ASSERT(0 <= column && column < BTRFS_LIST_ALL);
+	UASSERT(0 <= column && column < BTRFS_LIST_ALL);
 
 	switch (column) {
 	case BTRFS_LIST_OBJECTID:
diff --git a/common/device-utils.c b/common/device-utils.c
index cb1a7a9d..2e8aeb8b 100644
--- a/common/device-utils.c
+++ b/common/device-utils.c
@@ -539,7 +539,7 @@ ssize_t btrfs_direct_pio(int rw, int fd, void *buf, size_t count, off_t offset)
 	int ret;
 	ssize_t ret_rw;
 
-	ASSERT(rw == READ || rw == WRITE);
+	UASSERT(rw == READ || rw == WRITE);
 
 	if (fstat(fd, &stat_buf) == -1) {
 		error("fstat failed: %m");
@@ -579,7 +579,7 @@ ssize_t btrfs_direct_pio(int rw, int fd, void *buf, size_t count, off_t offset)
 	}
 
 	if (rw == WRITE) {
-		ASSERT(iosize == count);
+		UASSERT(iosize == count);
 		memcpy(bounce_buf, buf, count);
 		ret_rw = pwrite(fd, bounce_buf, iosize, offset);
 	} else {
diff --git a/common/messages.h b/common/messages.h
index da97c045..b512544f 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -145,4 +145,10 @@ enum common_error {
 __attribute__ ((format (printf, 2, 3)))
 void error_msg(enum common_error error, const char *msg, ...);
 
+#ifndef BTRFS_DISABLE_BACKTRACE
+#define	UASSERT(c) assert_trace(#c, __FILE__, __func__, __LINE__, (long)(c))
+#else
+#define UASSERT(c) assert(c)
+#endif
+
 #endif
diff --git a/common/units.c b/common/units.c
index 8d708cdd..27eac098 100644
--- a/common/units.c
+++ b/common/units.c
@@ -79,7 +79,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod
 	/* Unknown mode */
 	if (!base) {
 		internal_error("unknown unit base, mode %u", unit_mode);
-		ASSERT(0);
+		UASSERT(0);
 		return -1;
 	}
 
@@ -135,7 +135,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, unsigned unit_mod
 	if (num_divs >= ARRAY_SIZE(unit_suffix_binary)) {
 		str[0] = '\0';
 		internal_error("unsupported unit suffix, index %d", num_divs);
-		ASSERT(0);
+		UASSERT(0);
 		return -1;
 	}
 
diff --git a/convert/common.c b/convert/common.c
index 1a85085f..f104d93f 100644
--- a/convert/common.c
+++ b/convert/common.c
@@ -44,7 +44,7 @@ static int reserve_free_space(struct cache_tree *free_tree, u64 len,
 	struct cache_extent *cache;
 	int found = 0;
 
-	ASSERT(ret_start != NULL);
+	UASSERT(ret_start != NULL);
 	cache = first_cache_extent(free_tree);
 	while (cache) {
 		if (cache->size > len) {
@@ -807,7 +807,7 @@ int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg,
 	int ret;
 
 	/* Source filesystem must be opened, checked and analyzed in advance */
-	ASSERT(!cache_tree_empty(used_space));
+	UASSERT(!cache_tree_empty(used_space));
 
 	/*
 	 * reserve space for temporary superblock first
diff --git a/convert/main.c b/convert/main.c
index 3f54ea30..16520914 100644
--- a/convert/main.c
+++ b/convert/main.c
@@ -1167,7 +1167,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
 	if (ret)
 		goto fail;
 
-	ASSERT(cctx.total_bytes != 0);
+	UASSERT(cctx.total_bytes != 0);
 	blocksize = cctx.blocksize;
 	if (blocksize < 4096) {
 		error("block size is too small: %u < 4096", blocksize);
diff --git a/image/main.c b/image/main.c
index 43ee660d..7fa215c1 100644
--- a/image/main.c
+++ b/image/main.c
@@ -1399,7 +1399,7 @@ static int restore_one_work(struct mdrestore_struct *mdres,
 	int compress_method = mdres->compress_method;
 	int ret;
 
-	ASSERT(is_power_of_2(bufsize));
+	UASSERT(is_power_of_2(bufsize));
 
 	if (compress_method == COMPRESS_ZLIB) {
 		strm.zalloc = Z_NULL;
diff --git a/libbtrfs/send-stream.c b/libbtrfs/send-stream.c
index 2e89814a..16aef3ab 100644
--- a/libbtrfs/send-stream.c
+++ b/libbtrfs/send-stream.c
@@ -26,6 +26,7 @@
 #include "libbtrfs/send-stream.h"
 #include "libbtrfs/ctree.h"
 #include "libbtrfs/crc32c.h"
+#include "common/messages.h"
 
 struct btrfs_send_stream {
 	char read_buf[BTRFS_SEND_BUF_SIZE];
@@ -108,7 +109,7 @@ static int read_cmd(struct btrfs_send_stream *sctx)
 
 	memset(sctx->cmd_attrs, 0, sizeof(sctx->cmd_attrs));
 
-	ASSERT(sizeof(*sctx->cmd_hdr) <= sizeof(sctx->read_buf));
+	UASSERT(sizeof(*sctx->cmd_hdr) <= sizeof(sctx->read_buf));
 	ret = read_buf(sctx, sctx->read_buf, sizeof(*sctx->cmd_hdr));
 	if (ret < 0)
 		goto out;
diff --git a/mkfs/main.c b/mkfs/main.c
index 686c6b2f..4856cf96 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -272,7 +272,7 @@ static int __recow_root(struct btrfs_trans_handle *trans, struct btrfs_root *roo
 			goto out;
 		ret = 0;
 		btrfs_item_key_to_cpu(path.nodes[0], &found_key, 0);
-		ASSERT(btrfs_comp_cpu_keys(&key, &found_key) == 0);
+		UASSERT(btrfs_comp_cpu_keys(&key, &found_key) == 0);
 
 next:
 		ret = btrfs_next_leaf(root, &path);
@@ -782,7 +782,7 @@ static int create_uuid_tree(struct btrfs_trans_handle *trans)
 	};
 	int ret = 0;
 
-	ASSERT(fs_info->uuid_root == NULL);
+	UASSERT(fs_info->uuid_root == NULL);
 	root = btrfs_create_tree(trans, fs_info, &key);
 	if (IS_ERR(root)) {
 		ret = PTR_ERR(root);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 05/11] btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (3 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 04/11] btrfs-progs: introduce UASSERT() for purely userspace code Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 06/11] btrfs-progs: remove the _on() related message helpers Josef Bacik
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Everybody who calls print_trace wraps it around this check, move the
check instead to print_trace and remove the check from all the callers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 common/messages.c    |  3 ---
 include/kerncompat.h | 10 +++-------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/common/messages.c b/common/messages.c
index 2d9d55c0..4ef7a34a 100644
--- a/common/messages.c
+++ b/common/messages.c
@@ -96,10 +96,7 @@ void internal_error(const char *fmt, ...)
 	vfprintf(stderr, fmt, vargs);
 	va_end(vargs);
 	fputc('\n', stderr);
-
-#ifndef BTRFS_DISABLE_BACKTRACE
 	print_trace();
-#endif
 }
 
 static bool should_print(int level)
diff --git a/include/kerncompat.h b/include/kerncompat.h
index 62b6a357..cb2a9400 100644
--- a/include/kerncompat.h
+++ b/include/kerncompat.h
@@ -94,17 +94,17 @@
 #define BUILD_ASSERT(x)
 #endif
 
-#ifndef BTRFS_DISABLE_BACKTRACE
-#define MAX_BACKTRACE	16
 static inline void print_trace(void)
 {
+#ifndef BTRFS_DISABLE_BACKTRACE
+#define MAX_BACKTRACE	16
 	void *array[MAX_BACKTRACE];
 	int size;
 
 	size = backtrace(array, MAX_BACKTRACE);
 	backtrace_symbols_fd(array, size, 2);
-}
 #endif
+}
 
 static inline void warning_trace(const char *assertion, const char *filename,
 			      const char *func, unsigned line, long val)
@@ -114,9 +114,7 @@ static inline void warning_trace(const char *assertion, const char *filename,
 	fprintf(stderr,
 		"%s:%u: %s: Warning: assertion `%s` failed, value %ld\n",
 		filename, line, func, assertion, val);
-#ifndef BTRFS_DISABLE_BACKTRACE
 	print_trace();
-#endif
 }
 
 static inline void bugon_trace(const char *assertion, const char *filename,
@@ -127,9 +125,7 @@ static inline void bugon_trace(const char *assertion, const char *filename,
 	fprintf(stderr,
 		"%s:%u: %s: BUG_ON `%s` triggered, value %ld\n",
 		filename, line, func, assertion, val);
-#ifndef BTRFS_DISABLE_BACKTRACE
 	print_trace();
-#endif
 	abort();
 	exit(1);
 }
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 06/11] btrfs-progs: remove the _on() related message helpers
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (4 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 05/11] btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-05-02 20:35   ` David Sterba
  2023-04-19 21:13 ` [PATCH 07/11] btrfs-progs: consolidate the btrfs " Josef Bacik
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

We have different helpers for warning_on and error_on(), which take the
condition and then do the printf.  However we can just check the
condition in the macro and call the normal warning or error helper, so
clean this usage up and delete the unneeded message helpers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 common/messages.c | 34 ----------------------------------
 common/messages.h | 20 ++++++--------------
 2 files changed, 6 insertions(+), 48 deletions(-)

diff --git a/common/messages.c b/common/messages.c
index 4ef7a34a..5e7f2dfa 100644
--- a/common/messages.c
+++ b/common/messages.c
@@ -52,40 +52,6 @@ void __btrfs_error(const char *fmt, ...)
 	fputc('\n', stderr);
 }
 
-__attribute__ ((format (printf, 2, 3)))
-int __btrfs_warning_on(int condition, const char *fmt, ...)
-{
-	va_list args;
-
-	if (!condition)
-		return 0;
-
-	fputs(PREFIX_WARNING, stderr);
-	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
-	va_end(args);
-	fputc('\n', stderr);
-
-	return 1;
-}
-
-__attribute__ ((format (printf, 2, 3)))
-int __btrfs_error_on(int condition, const char *fmt, ...)
-{
-	va_list args;
-
-	if (!condition)
-		return 0;
-
-	fputs(PREFIX_ERROR, stderr);
-	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
-	va_end(args);
-	fputc('\n', stderr);
-
-	return 1;
-}
-
 __attribute__ ((format (printf, 1, 2)))
 void internal_error(const char *fmt, ...)
 {
diff --git a/common/messages.h b/common/messages.h
index b512544f..6a105484 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -50,13 +50,11 @@
 
 #define error_on(cond, fmt, ...)					\
 	do {								\
-		if ((cond))						\
+		if ((cond)) {						\
 			PRINT_TRACE_ON_ERROR;				\
-		if ((cond))						\
 			PRINT_VERBOSE_ERROR;				\
-		__btrfs_error_on((cond), (fmt), ##__VA_ARGS__);		\
-		if ((cond))						\
-			DO_ABORT_ON_ERROR;				\
+			__btrfs_error((fmt), ##__VA_ARGS__);		\
+		}							\
 	} while (0)
 
 #define error_btrfs_util(err)						\
@@ -81,11 +79,11 @@
 
 #define warning_on(cond, fmt, ...)					\
 	do {								\
-		if ((cond))						\
+		if ((cond)) {						\
 			PRINT_TRACE_ON_ERROR;				\
-		if ((cond))						\
 			PRINT_VERBOSE_ERROR;				\
-		__btrfs_warning_on((cond), (fmt), ##__VA_ARGS__);	\
+			__btrfs_warning((fmt), ##__VA_ARGS__);		\
+		}							\
 	} while (0)
 
 __attribute__ ((format (printf, 1, 2)))
@@ -94,12 +92,6 @@ void __btrfs_warning(const char *fmt, ...);
 __attribute__ ((format (printf, 1, 2)))
 void __btrfs_error(const char *fmt, ...);
 
-__attribute__ ((format (printf, 2, 3)))
-int __btrfs_warning_on(int condition, const char *fmt, ...);
-
-__attribute__ ((format (printf, 2, 3)))
-int __btrfs_error_on(int condition, const char *fmt, ...);
-
 __attribute__ ((format (printf, 1, 2)))
 void internal_error(const char *fmt, ...);
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 07/11] btrfs-progs: consolidate the btrfs message helpers
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (5 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 06/11] btrfs-progs: remove the _on() related message helpers Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 08/11] btrfs-progs: rename the qgroup structs to match the kernel Josef Bacik
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

These helpers all do variations on the same thing, so add a helper to
just do the printf part, and a macro to handle the special prefix and
postfix, and then make the helpers just use the macro and new helper.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 common/messages.c | 32 +-------------------------------
 common/messages.h | 30 +++++++++++++++++++++++-------
 2 files changed, 24 insertions(+), 38 deletions(-)

diff --git a/common/messages.c b/common/messages.c
index 5e7f2dfa..d6dc219b 100644
--- a/common/messages.c
+++ b/common/messages.c
@@ -19,9 +19,6 @@
 #include "common/messages.h"
 #include "common/utils.h"
 
-#define PREFIX_ERROR		"ERROR: "
-#define PREFIX_WARNING		"WARNING: "
-
 static const char *common_error_string[] = {
 	[ERROR_MSG_MEMORY]	= "not enough memory",
 	[ERROR_MSG_START_TRANS] = "failed to start transaction",
@@ -29,40 +26,13 @@ static const char *common_error_string[] = {
 };
 
 __attribute__ ((format (printf, 1, 2)))
-void __btrfs_warning(const char *fmt, ...)
-{
-	va_list args;
-
-	fputs(PREFIX_WARNING, stderr);
-	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
-	va_end(args);
-	fputc('\n', stderr);
-}
-
-__attribute__ ((format (printf, 1, 2)))
-void __btrfs_error(const char *fmt, ...)
+void __btrfs_printf(const char *fmt, ...)
 {
 	va_list args;
 
-	fputs(PREFIX_ERROR, stderr);
 	va_start(args, fmt);
 	vfprintf(stderr, fmt, args);
 	va_end(args);
-	fputc('\n', stderr);
-}
-
-__attribute__ ((format (printf, 1, 2)))
-void internal_error(const char *fmt, ...)
-{
-	va_list vargs;
-
-	va_start(vargs, fmt);
-	fputs("INTERNAL " PREFIX_ERROR, stderr);
-	vfprintf(stderr, fmt, vargs);
-	va_end(vargs);
-	fputc('\n', stderr);
-	print_trace();
 }
 
 static bool should_print(int level)
diff --git a/common/messages.h b/common/messages.h
index 6a105484..4bb9866e 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -40,6 +40,28 @@
 #define DO_ABORT_ON_ERROR	do { } while (0)
 #endif
 
+#define PREFIX_ERROR		"ERROR: "
+#define PREFIX_WARNING		"WARNING: "
+
+#define __btrfs_msg(prefix, fmt, ...)					\
+	do {								\
+		fputs((prefix), stderr);				\
+		__btrfs_printf((fmt), ##__VA_ARGS__);			\
+		fputc('\n', stderr);					\
+	} while (0)
+
+#define __btrfs_warning(fmt, ...) \
+	__btrfs_msg(PREFIX_WARNING, fmt, ##__VA_ARGS__)
+
+#define __btrfs_error(fmt, ...) \
+	__btrfs_msg(PREFIX_ERROR, fmt, ##__VA_ARGS__)
+
+#define internal_error(fmt, ...)						\
+	do {									\
+		__btrfs_msg("INTERNAL " PREFIX_ERROR, fmt, ##__VA_ARGS__);	\
+		print_trace();							\
+	} while (0)
+
 #define error(fmt, ...)							\
 	do {								\
 		PRINT_TRACE_ON_ERROR;					\
@@ -87,13 +109,7 @@
 	} while (0)
 
 __attribute__ ((format (printf, 1, 2)))
-void __btrfs_warning(const char *fmt, ...);
-
-__attribute__ ((format (printf, 1, 2)))
-void __btrfs_error(const char *fmt, ...);
-
-__attribute__ ((format (printf, 1, 2)))
-void internal_error(const char *fmt, ...);
+void __btrfs_printf(const char *fmt, ...);
 
 /*
  * Level of messages that must be printed by default (in case the verbosity
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 08/11] btrfs-progs: rename the qgroup structs to match the kernel
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (6 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 07/11] btrfs-progs: consolidate the btrfs " Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 09/11] btrfs-progs: remove fs_info argument from btrfs_check_* helpers Josef Bacik
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Now that the libbtrfs stuff has it's own local copy of ctree.h and
ioctl.h, let's rename these qgroup struct members to match the kernel
names, this way it'll make it easier to sync the kernel code into
btrfs-progs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/qgroup-verify.c      | 16 ++++----
 cmds/qgroup.c              | 20 ++++------
 kernel-shared/ctree.h      | 80 +++++++++++++++++++-------------------
 kernel-shared/print-tree.c | 18 ++++-----
 4 files changed, 64 insertions(+), 70 deletions(-)

diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c
index 3d7b9ddf..db49e3c9 100644
--- a/check/qgroup-verify.c
+++ b/check/qgroup-verify.c
@@ -870,12 +870,12 @@ static struct qgroup_count *alloc_count(struct btrfs_disk_key *key,
 		c->key = *key;
 
 		item = &c->diskinfo;
-		item->referenced = btrfs_qgroup_info_referenced(leaf, disk);
+		item->referenced = btrfs_qgroup_info_rfer(leaf, disk);
 		item->referenced_compressed =
-			btrfs_qgroup_info_referenced_compressed(leaf, disk);
-		item->exclusive = btrfs_qgroup_info_exclusive(leaf, disk);
+			btrfs_qgroup_info_rfer_cmpr(leaf, disk);
+		item->exclusive = btrfs_qgroup_info_excl(leaf, disk);
 		item->exclusive_compressed =
-			btrfs_qgroup_info_exclusive_compressed(leaf, disk);
+			btrfs_qgroup_info_excl_cmpr(leaf, disk);
 		INIT_LIST_HEAD(&c->groups);
 		INIT_LIST_HEAD(&c->members);
 		INIT_LIST_HEAD(&c->bad_list);
@@ -1594,14 +1594,14 @@ static int repair_qgroup_info(struct btrfs_fs_info *info,
 	btrfs_set_qgroup_info_generation(path.nodes[0], info_item,
 					 trans->transid);
 
-	btrfs_set_qgroup_info_referenced(path.nodes[0], info_item,
+	btrfs_set_qgroup_info_rfer(path.nodes[0], info_item,
 					 count->info.referenced);
-	btrfs_set_qgroup_info_referenced_compressed(path.nodes[0], info_item,
+	btrfs_set_qgroup_info_rfer_cmpr(path.nodes[0], info_item,
 					    count->info.referenced_compressed);
 
-	btrfs_set_qgroup_info_exclusive(path.nodes[0], info_item,
+	btrfs_set_qgroup_info_excl(path.nodes[0], info_item,
 					count->info.exclusive);
-	btrfs_set_qgroup_info_exclusive_compressed(path.nodes[0], info_item,
+	btrfs_set_qgroup_info_excl_cmpr(path.nodes[0], info_item,
 					   count->info.exclusive_compressed);
 
 	btrfs_mark_buffer_dirty(path.nodes[0]);
diff --git a/cmds/qgroup.c b/cmds/qgroup.c
index 125362b8..ab4e9ecf 100644
--- a/cmds/qgroup.c
+++ b/cmds/qgroup.c
@@ -807,12 +807,11 @@ static int update_qgroup_info(int fd, struct qgroup_lookup *qgroup_lookup, u64 q
 		return PTR_ERR(bq);
 
 	bq->info.generation = btrfs_stack_qgroup_info_generation(info);
-	bq->info.referenced = btrfs_stack_qgroup_info_referenced(info);
+	bq->info.referenced = btrfs_stack_qgroup_info_rfer(info);
 	bq->info.referenced_compressed =
-			btrfs_stack_qgroup_info_referenced_compressed(info);
-	bq->info.exclusive = btrfs_stack_qgroup_info_exclusive(info);
-	bq->info.exclusive_compressed =
-			btrfs_stack_qgroup_info_exclusive_compressed(info);
+		btrfs_stack_qgroup_info_rfer_cmpr(info);
+	bq->info.exclusive = btrfs_stack_qgroup_info_excl(info);
+	bq->info.exclusive_compressed = btrfs_stack_qgroup_info_excl_cmpr(info);
 
 	return 0;
 }
@@ -828,13 +827,10 @@ static int update_qgroup_limit(int fd, struct qgroup_lookup *qgroup_lookup,
 		return PTR_ERR(bq);
 
 	bq->limit.flags = btrfs_stack_qgroup_limit_flags(limit);
-	bq->limit.max_referenced =
-			btrfs_stack_qgroup_limit_max_referenced(limit);
-	bq->limit.max_exclusive =
-			btrfs_stack_qgroup_limit_max_exclusive(limit);
-	bq->limit.rsv_referenced =
-			btrfs_stack_qgroup_limit_rsv_referenced(limit);
-	bq->limit.rsv_exclusive = btrfs_stack_qgroup_limit_rsv_exclusive(limit);
+	bq->limit.max_referenced = btrfs_stack_qgroup_limit_max_rfer(limit);
+	bq->limit.max_exclusive = btrfs_stack_qgroup_limit_max_excl(limit);
+	bq->limit.rsv_referenced = btrfs_stack_qgroup_limit_rsv_rfer(limit);
+	bq->limit.rsv_exclusive = btrfs_stack_qgroup_limit_rsv_excl(limit);
 
 	return 0;
 }
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 93e1850c..df7526d4 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -1103,10 +1103,10 @@ struct btrfs_free_space_info {
 
 struct btrfs_qgroup_info_item {
 	__le64 generation;
-	__le64 referenced;
-	__le64 referenced_compressed;
-	__le64 exclusive;
-	__le64 exclusive_compressed;
+	__le64 rfer;
+	__le64 rfer_cmpr;
+	__le64 excl;
+	__le64 excl_cmpr;
 } __attribute__ ((__packed__));
 
 /* flags definition for qgroup limits */
@@ -1119,10 +1119,10 @@ struct btrfs_qgroup_info_item {
 
 struct btrfs_qgroup_limit_item {
 	__le64 flags;
-	__le64 max_referenced;
-	__le64 max_exclusive;
-	__le64 rsv_referenced;
-	__le64 rsv_exclusive;
+	__le64 max_rfer;
+	__le64 max_excl;
+	__le64 rsv_rfer;
+	__le64 rsv_excl;
 } __attribute__ ((__packed__));
 
 struct btrfs_space_info {
@@ -2466,48 +2466,48 @@ BTRFS_SETGET_STACK_FUNCS(stack_qgroup_status_rescan,
 /* btrfs_qgroup_info_item */
 BTRFS_SETGET_FUNCS(qgroup_info_generation, struct btrfs_qgroup_info_item,
 		   generation, 64);
-BTRFS_SETGET_FUNCS(qgroup_info_referenced, struct btrfs_qgroup_info_item,
-		   referenced, 64);
-BTRFS_SETGET_FUNCS(qgroup_info_referenced_compressed,
-		   struct btrfs_qgroup_info_item, referenced_compressed, 64);
-BTRFS_SETGET_FUNCS(qgroup_info_exclusive, struct btrfs_qgroup_info_item,
-		   exclusive, 64);
-BTRFS_SETGET_FUNCS(qgroup_info_exclusive_compressed,
-		   struct btrfs_qgroup_info_item, exclusive_compressed, 64);
+BTRFS_SETGET_FUNCS(qgroup_info_rfer, struct btrfs_qgroup_info_item,
+		   rfer, 64);
+BTRFS_SETGET_FUNCS(qgroup_info_rfer_cmpr,
+		   struct btrfs_qgroup_info_item, rfer_cmpr, 64);
+BTRFS_SETGET_FUNCS(qgroup_info_excl, struct btrfs_qgroup_info_item,
+		   excl, 64);
+BTRFS_SETGET_FUNCS(qgroup_info_excl_cmpr,
+		   struct btrfs_qgroup_info_item, excl_cmpr, 64);
 
 BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_generation,
 			 struct btrfs_qgroup_info_item, generation, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_referenced,
-			 struct btrfs_qgroup_info_item, referenced, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_referenced_compressed,
-		   struct btrfs_qgroup_info_item, referenced_compressed, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_exclusive,
-			 struct btrfs_qgroup_info_item, exclusive, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_exclusive_compressed,
-		   struct btrfs_qgroup_info_item, exclusive_compressed, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_rfer,
+			 struct btrfs_qgroup_info_item, rfer, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_rfer_cmpr,
+		   struct btrfs_qgroup_info_item, rfer_cmpr, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_excl,
+			 struct btrfs_qgroup_info_item, excl, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_info_excl_cmpr,
+		   struct btrfs_qgroup_info_item, excl_cmpr, 64);
 
 /* btrfs_qgroup_limit_item */
 BTRFS_SETGET_FUNCS(qgroup_limit_flags, struct btrfs_qgroup_limit_item,
 		   flags, 64);
-BTRFS_SETGET_FUNCS(qgroup_limit_max_referenced, struct btrfs_qgroup_limit_item,
-		   max_referenced, 64);
-BTRFS_SETGET_FUNCS(qgroup_limit_max_exclusive, struct btrfs_qgroup_limit_item,
-		   max_exclusive, 64);
-BTRFS_SETGET_FUNCS(qgroup_limit_rsv_referenced, struct btrfs_qgroup_limit_item,
-		   rsv_referenced, 64);
-BTRFS_SETGET_FUNCS(qgroup_limit_rsv_exclusive, struct btrfs_qgroup_limit_item,
-		   rsv_exclusive, 64);
+BTRFS_SETGET_FUNCS(qgroup_limit_max_rfer, struct btrfs_qgroup_limit_item,
+		   max_rfer, 64);
+BTRFS_SETGET_FUNCS(qgroup_limit_max_excl, struct btrfs_qgroup_limit_item,
+		   max_excl, 64);
+BTRFS_SETGET_FUNCS(qgroup_limit_rsv_rfer, struct btrfs_qgroup_limit_item,
+		   rsv_rfer, 64);
+BTRFS_SETGET_FUNCS(qgroup_limit_rsv_excl, struct btrfs_qgroup_limit_item,
+		   rsv_excl, 64);
 
 BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_flags,
 			 struct btrfs_qgroup_limit_item, flags, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_referenced,
-			 struct btrfs_qgroup_limit_item, max_referenced, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_exclusive,
-			 struct btrfs_qgroup_limit_item, max_exclusive, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_referenced,
-			 struct btrfs_qgroup_limit_item, rsv_referenced, 64);
-BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_exclusive,
-			 struct btrfs_qgroup_limit_item, rsv_exclusive, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_rfer,
+			 struct btrfs_qgroup_limit_item, max_rfer, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_max_excl,
+			 struct btrfs_qgroup_limit_item, max_excl, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_rfer,
+			 struct btrfs_qgroup_limit_item, rsv_rfer, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_qgroup_limit_rsv_excl,
+			 struct btrfs_qgroup_limit_item, rsv_excl, 64);
 
 /* btrfs_balance_item */
 BTRFS_SETGET_FUNCS(balance_item_flags, struct btrfs_balance_item, flags, 64);
diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
index 3fb6a37c..37a1f74c 100644
--- a/kernel-shared/print-tree.c
+++ b/kernel-shared/print-tree.c
@@ -1089,12 +1089,10 @@ static void print_qgroup_info(struct extent_buffer *eb, int slot)
 		"\t\treferenced %llu referenced_compressed %llu\n"
 		"\t\texclusive %llu exclusive_compressed %llu\n",
 		(unsigned long long)btrfs_qgroup_info_generation(eb, qg_info),
-		(unsigned long long)btrfs_qgroup_info_referenced(eb, qg_info),
-		(unsigned long long)btrfs_qgroup_info_referenced_compressed(eb,
-								       qg_info),
-		(unsigned long long)btrfs_qgroup_info_exclusive(eb, qg_info),
-		(unsigned long long)btrfs_qgroup_info_exclusive_compressed(eb,
-								      qg_info));
+		(unsigned long long)btrfs_qgroup_info_rfer(eb, qg_info),
+		(unsigned long long)btrfs_qgroup_info_rfer_cmpr(eb, qg_info),
+		(unsigned long long)btrfs_qgroup_info_excl(eb, qg_info),
+		(unsigned long long)btrfs_qgroup_info_excl_cmpr(eb, qg_info));
 }
 
 static void print_qgroup_limit(struct extent_buffer *eb, int slot)
@@ -1106,10 +1104,10 @@ static void print_qgroup_limit(struct extent_buffer *eb, int slot)
 		"\t\tmax_referenced %lld max_exclusive %lld\n"
 		"\t\trsv_referenced %lld rsv_exclusive %lld\n",
 		(unsigned long long)btrfs_qgroup_limit_flags(eb, qg_limit),
-		(long long)btrfs_qgroup_limit_max_referenced(eb, qg_limit),
-		(long long)btrfs_qgroup_limit_max_exclusive(eb, qg_limit),
-		(long long)btrfs_qgroup_limit_rsv_referenced(eb, qg_limit),
-		(long long)btrfs_qgroup_limit_rsv_exclusive(eb, qg_limit));
+		(long long)btrfs_qgroup_limit_max_rfer(eb, qg_limit),
+		(long long)btrfs_qgroup_limit_max_excl(eb, qg_limit),
+		(long long)btrfs_qgroup_limit_rsv_rfer(eb, qg_limit),
+		(long long)btrfs_qgroup_limit_rsv_excl(eb, qg_limit));
 }
 
 static void print_persistent_item(struct extent_buffer *eb, void *ptr,
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 09/11] btrfs-progs: remove fs_info argument from btrfs_check_* helpers
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (7 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 08/11] btrfs-progs: rename the qgroup structs to match the kernel Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 10/11] btrfs-progs: add a btrfs check helper for checking blocks Josef Bacik
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This can be pulled out of the extent buffer that is passed in, drop the
fs_info argument from the function.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/main.c            | 12 ++++++------
 check/mode-lowmem.c     | 10 +++++-----
 kernel-shared/ctree.c   | 12 ++++++------
 kernel-shared/ctree.h   |  6 ++----
 kernel-shared/disk-io.c |  4 ++--
 5 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/check/main.c b/check/main.c
index 1a9ad50c..8c3a10a1 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1921,9 +1921,9 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 		}
 
 		if (btrfs_is_leaf(next))
-			status = btrfs_check_leaf(gfs_info, NULL, next);
+			status = btrfs_check_leaf(NULL, next);
 		else
-			status = btrfs_check_node(gfs_info, NULL, next);
+			status = btrfs_check_node(NULL, next);
 		if (status != BTRFS_TREE_BLOCK_CLEAN) {
 			free_extent_buffer(next);
 			err = -EIO;
@@ -3702,9 +3702,9 @@ static int check_fs_root(struct btrfs_root *root,
 
 	/* We may not have checked the root block, lets do that now */
 	if (btrfs_is_leaf(root->node))
-		status = btrfs_check_leaf(gfs_info, NULL, root->node);
+		status = btrfs_check_leaf(NULL, root->node);
 	else
-		status = btrfs_check_node(gfs_info, NULL, root->node);
+		status = btrfs_check_node(NULL, root->node);
 	if (status != BTRFS_TREE_BLOCK_CLEAN)
 		return -EIO;
 
@@ -4608,9 +4608,9 @@ static int check_block(struct btrfs_root *root,
 	rec->info_level = level;
 
 	if (btrfs_is_leaf(buf))
-		status = btrfs_check_leaf(gfs_info, &rec->parent_key, buf);
+		status = btrfs_check_leaf(&rec->parent_key, buf);
 	else
-		status = btrfs_check_node(gfs_info, &rec->parent_key, buf);
+		status = btrfs_check_node(&rec->parent_key, buf);
 
 	if (status != BTRFS_TREE_BLOCK_CLEAN) {
 		if (opt_check_repair)
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index f0e5f8d6..1672da26 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -2695,7 +2695,7 @@ static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path)
 		 * we need to bail otherwise we could end up stuck.
 		 */
 		if (path->slots[0] == 0 &&
-		    btrfs_check_leaf(gfs_info, NULL, path->nodes[0]))
+		    btrfs_check_leaf(NULL, path->nodes[0]))
 			ret = -EIO;
 
 		if (ret < 0) {
@@ -5001,7 +5001,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 		if (*level == 0) {
 			/* skip duplicate check */
 			if (check || !check_all) {
-				ret = btrfs_check_leaf(gfs_info, NULL, cur);
+				ret = btrfs_check_leaf(NULL, cur);
 				if (ret != BTRFS_TREE_BLOCK_CLEAN) {
 					err |= -EIO;
 					break;
@@ -5018,7 +5018,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			break;
 		}
 		if (check || !check_all) {
-			ret = btrfs_check_node(gfs_info, NULL, cur);
+			ret = btrfs_check_node(NULL, cur);
 			if (ret != BTRFS_TREE_BLOCK_CLEAN) {
 				err |= -EIO;
 				break;
@@ -5066,9 +5066,9 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			break;
 
 		if (btrfs_is_leaf(next))
-			status = btrfs_check_leaf(gfs_info, NULL, next);
+			status = btrfs_check_leaf(NULL, next);
 		else
-			status = btrfs_check_node(gfs_info, NULL, next);
+			status = btrfs_check_node(NULL, next);
 		if (status != BTRFS_TREE_BLOCK_CLEAN) {
 			free_extent_buffer(next);
 			err |= -EIO;
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
index 7d1b1316..fb56a863 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -612,9 +612,9 @@ static void generic_err(const struct extent_buffer *buf, int slot,
 }
 
 enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_fs_info *fs_info,
-		 struct btrfs_key *parent_key, struct extent_buffer *node)
+btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *node)
 {
+	struct btrfs_fs_info *fs_info = node->fs_info;
 	unsigned long nr = btrfs_header_nritems(node);
 	struct btrfs_key key, next_key;
 	int slot;
@@ -683,9 +683,9 @@ fail:
 }
 
 enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_fs_info *fs_info,
-		 struct btrfs_key *parent_key, struct extent_buffer *leaf)
+btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *leaf)
 {
+	struct btrfs_fs_info *fs_info = leaf->fs_info;
 	/* No valid key type is 0, so all key should be larger than this key */
 	struct btrfs_key prev_key = {0, 0, 0};
 	struct btrfs_key key;
@@ -811,9 +811,9 @@ static int noinline check_block(struct btrfs_fs_info *fs_info,
 		parent_key_ptr = &key;
 	}
 	if (level == 0)
-		ret = btrfs_check_leaf(fs_info, parent_key_ptr, path->nodes[0]);
+		ret = btrfs_check_leaf(parent_key_ptr, path->nodes[0]);
 	else
-		ret = btrfs_check_node(fs_info, parent_key_ptr, path->nodes[level]);
+		ret = btrfs_check_node(parent_key_ptr, path->nodes[level]);
 	if (ret == BTRFS_TREE_BLOCK_CLEAN)
 		return 0;
 	return -EIO;
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index df7526d4..13264387 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -2705,11 +2705,9 @@ int btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
 int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 		int level, int slot);
 enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_fs_info *fs_info,
-		 struct btrfs_key *parent_key, struct extent_buffer *buf);
+btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *buf);
 enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_fs_info *fs_info,
-		 struct btrfs_key *parent_key, struct extent_buffer *buf);
+btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *buf);
 void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
 		      int level, int slot, u64 objectid);
 struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index 3d2574d9..b5ad89c2 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -389,9 +389,9 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
 			 * btrfs ins dump-tree.
 			 */
 			if (btrfs_header_level(eb))
-				ret = btrfs_check_node(fs_info, NULL, eb);
+				ret = btrfs_check_node(NULL, eb);
 			else
-				ret = btrfs_check_leaf(fs_info, NULL, eb);
+				ret = btrfs_check_leaf(NULL, eb);
 			if (!ret || candidate_mirror == mirror_num) {
 				btrfs_set_buffer_uptodate(eb);
 				return eb;
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 10/11] btrfs-progs: add a btrfs check helper for checking blocks
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (8 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 09/11] btrfs-progs: remove fs_info argument from btrfs_check_* helpers Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-04-19 21:13 ` [PATCH 11/11] btrfs-progs: remove parent_key arg from btrfs_check_* helpers Josef Bacik
  2023-05-02 20:56 ` [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared David Sterba
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

btrfs check wants to be able to record corrupted extents if it finds any
bad blocks.  This has been done directly inside of the
btrfs_check_leaf/btrfs_check_node helpers, but these are going to be
sync'ed from the kernel in the future.  Add another helper and move the
corrupt block handling into this helper and keep it inside of the check
code.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/main.c          | 16 +++-------------
 check/mode-lowmem.c   | 11 ++++-------
 check/repair.c        | 29 +++++++++++++++++++++++++++++
 check/repair.h        |  3 ++-
 kernel-shared/ctree.c | 22 ++--------------------
 5 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/check/main.c b/check/main.c
index 8c3a10a1..467c8a57 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1920,10 +1920,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			goto out;
 		}
 
-		if (btrfs_is_leaf(next))
-			status = btrfs_check_leaf(NULL, next);
-		else
-			status = btrfs_check_node(NULL, next);
+		status = btrfs_check_block_for_repair(next, NULL);
 		if (status != BTRFS_TREE_BLOCK_CLEAN) {
 			free_extent_buffer(next);
 			err = -EIO;
@@ -3701,10 +3698,7 @@ static int check_fs_root(struct btrfs_root *root,
 	wc->root_level = level;
 
 	/* We may not have checked the root block, lets do that now */
-	if (btrfs_is_leaf(root->node))
-		status = btrfs_check_leaf(NULL, root->node);
-	else
-		status = btrfs_check_node(NULL, root->node);
+	status = btrfs_check_block_for_repair(root->node, NULL);
 	if (status != BTRFS_TREE_BLOCK_CLEAN)
 		return -EIO;
 
@@ -4607,11 +4601,7 @@ static int check_block(struct btrfs_root *root,
 	}
 	rec->info_level = level;
 
-	if (btrfs_is_leaf(buf))
-		status = btrfs_check_leaf(&rec->parent_key, buf);
-	else
-		status = btrfs_check_node(&rec->parent_key, buf);
-
+	status = btrfs_check_block_for_repair(buf, &rec->parent_key);
 	if (status != BTRFS_TREE_BLOCK_CLEAN) {
 		if (opt_check_repair)
 			status = try_to_fix_bad_block(root, buf, status);
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 1672da26..3cf8d97f 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -2695,7 +2695,7 @@ static int check_inode_item(struct btrfs_root *root, struct btrfs_path *path)
 		 * we need to bail otherwise we could end up stuck.
 		 */
 		if (path->slots[0] == 0 &&
-		    btrfs_check_leaf(NULL, path->nodes[0]))
+		    btrfs_check_block_for_repair(path->nodes[0], NULL))
 			ret = -EIO;
 
 		if (ret < 0) {
@@ -5001,7 +5001,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 		if (*level == 0) {
 			/* skip duplicate check */
 			if (check || !check_all) {
-				ret = btrfs_check_leaf(NULL, cur);
+				ret = btrfs_check_block_for_repair(cur, NULL);
 				if (ret != BTRFS_TREE_BLOCK_CLEAN) {
 					err |= -EIO;
 					break;
@@ -5018,7 +5018,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			break;
 		}
 		if (check || !check_all) {
-			ret = btrfs_check_node(NULL, cur);
+			ret = btrfs_check_block_for_repair(cur, NULL);
 			if (ret != BTRFS_TREE_BLOCK_CLEAN) {
 				err |= -EIO;
 				break;
@@ -5065,10 +5065,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 		if (ret < 0)
 			break;
 
-		if (btrfs_is_leaf(next))
-			status = btrfs_check_leaf(NULL, next);
-		else
-			status = btrfs_check_node(NULL, next);
+		status = btrfs_check_block_for_repair(next, NULL);
 		if (status != BTRFS_TREE_BLOCK_CLEAN) {
 			free_extent_buffer(next);
 			err |= -EIO;
diff --git a/check/repair.c b/check/repair.c
index f84df9cf..71b2a277 100644
--- a/check/repair.c
+++ b/check/repair.c
@@ -299,3 +299,32 @@ out:
 	extent_io_tree_cleanup(&used);
 	return ret;
 }
+
+enum btrfs_tree_block_status btrfs_check_block_for_repair(struct extent_buffer *eb,
+							  struct btrfs_key *first_key)
+{
+	struct btrfs_fs_info *fs_info = eb->fs_info;
+	enum btrfs_tree_block_status status;
+
+	if (btrfs_is_leaf(eb))
+		status = btrfs_check_leaf(first_key, eb);
+	else
+		status = btrfs_check_node(first_key, eb);
+
+	if (status == BTRFS_TREE_BLOCK_CLEAN)
+		return status;
+
+	if (btrfs_header_owner(eb) == BTRFS_EXTENT_TREE_OBJECTID) {
+		struct btrfs_key key;
+
+		if (first_key)
+			memcpy(&key, first_key, sizeof(struct btrfs_key));
+		else
+			btrfs_node_key_to_cpu(eb, &key, 0);
+		btrfs_add_corrupt_extent_record(fs_info, &key,
+						eb->start, eb->len,
+						btrfs_header_level(eb));
+	}
+	return status;
+
+}
diff --git a/check/repair.h b/check/repair.h
index 3e6ffcf6..d4222600 100644
--- a/check/repair.h
+++ b/check/repair.h
@@ -43,5 +43,6 @@ int btrfs_mark_used_tree_blocks(struct btrfs_fs_info *fs_info,
 				struct extent_io_tree *tree);
 int btrfs_mark_used_blocks(struct btrfs_fs_info *fs_info,
 			   struct extent_io_tree *tree);
-
+enum btrfs_tree_block_status btrfs_check_block_for_repair(struct extent_buffer *eb,
+							  struct btrfs_key *first_key);
 #endif
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
index fb56a863..c1c2059b 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -668,17 +668,8 @@ btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *node)
 			goto fail;
 		}
 	}
-	return BTRFS_TREE_BLOCK_CLEAN;
+	ret = BTRFS_TREE_BLOCK_CLEAN;
 fail:
-	if (btrfs_header_owner(node) == BTRFS_EXTENT_TREE_OBJECTID) {
-		if (parent_key)
-			memcpy(&key, parent_key, sizeof(struct btrfs_key));
-		else
-			btrfs_node_key_to_cpu(node, &key, 0);
-		btrfs_add_corrupt_extent_record(fs_info, &key,
-						node->start, node->len,
-						btrfs_header_level(node));
-	}
 	return ret;
 }
 
@@ -782,17 +773,8 @@ btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *leaf)
 		prev_key.offset = key.offset;
 	}
 
-	return BTRFS_TREE_BLOCK_CLEAN;
+	ret = BTRFS_TREE_BLOCK_CLEAN;
 fail:
-	if (btrfs_header_owner(leaf) == BTRFS_EXTENT_TREE_OBJECTID) {
-		if (parent_key)
-			memcpy(&key, parent_key, sizeof(struct btrfs_key));
-		else
-			btrfs_item_key_to_cpu(leaf, &key, 0);
-
-		btrfs_add_corrupt_extent_record(fs_info, &key,
-						leaf->start, leaf->len, 0);
-	}
 	return ret;
 }
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 11/11] btrfs-progs: remove parent_key arg from btrfs_check_* helpers
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (9 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 10/11] btrfs-progs: add a btrfs check helper for checking blocks Josef Bacik
@ 2023-04-19 21:13 ` Josef Bacik
  2023-05-02 20:56 ` [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared David Sterba
  11 siblings, 0 replies; 14+ messages in thread
From: Josef Bacik @ 2023-04-19 21:13 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Now that this is unused by these helpers and only used by the repair
related code we can remove this argument from the main helpers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/repair.c          |  4 ++--
 kernel-shared/ctree.c   | 17 ++++-------------
 kernel-shared/ctree.h   |  6 ++----
 kernel-shared/disk-io.c |  4 ++--
 4 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/check/repair.c b/check/repair.c
index 71b2a277..8c1e2027 100644
--- a/check/repair.c
+++ b/check/repair.c
@@ -307,9 +307,9 @@ enum btrfs_tree_block_status btrfs_check_block_for_repair(struct extent_buffer *
 	enum btrfs_tree_block_status status;
 
 	if (btrfs_is_leaf(eb))
-		status = btrfs_check_leaf(first_key, eb);
+		status = btrfs_check_leaf(eb);
 	else
-		status = btrfs_check_node(first_key, eb);
+		status = btrfs_check_node(eb);
 
 	if (status == BTRFS_TREE_BLOCK_CLEAN)
 		return status;
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
index c1c2059b..911ec51c 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -611,8 +611,7 @@ static void generic_err(const struct extent_buffer *buf, int slot,
 	fprintf(stderr, "\n");
 }
 
-enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *node)
+enum btrfs_tree_block_status btrfs_check_node(struct extent_buffer *node)
 {
 	struct btrfs_fs_info *fs_info = node->fs_info;
 	unsigned long nr = btrfs_header_nritems(node);
@@ -673,8 +672,7 @@ fail:
 	return ret;
 }
 
-enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *leaf)
+enum btrfs_tree_block_status btrfs_check_leaf(struct extent_buffer *leaf)
 {
 	struct btrfs_fs_info *fs_info = leaf->fs_info;
 	/* No valid key type is 0, so all key should be larger than this key */
@@ -781,21 +779,14 @@ fail:
 static int noinline check_block(struct btrfs_fs_info *fs_info,
 				struct btrfs_path *path, int level)
 {
-	struct btrfs_key key;
-	struct btrfs_key *parent_key_ptr = NULL;
 	enum btrfs_tree_block_status ret;
 
 	if (path->skip_check_block)
 		return 0;
-	if (path->nodes[level + 1]) {
-		btrfs_node_key_to_cpu(path->nodes[level + 1], &key,
-				     path->slots[level + 1]);
-		parent_key_ptr = &key;
-	}
 	if (level == 0)
-		ret = btrfs_check_leaf(parent_key_ptr, path->nodes[0]);
+		ret = btrfs_check_leaf(path->nodes[0]);
 	else
-		ret = btrfs_check_node(parent_key_ptr, path->nodes[level]);
+		ret = btrfs_check_node(path->nodes[level]);
 	if (ret == BTRFS_TREE_BLOCK_CLEAN)
 		return 0;
 	return -EIO;
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 13264387..d81d7c02 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -2704,10 +2704,8 @@ int btrfs_convert_one_bg(struct btrfs_trans_handle *trans, u64 bytenr);
 int btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
 int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 		int level, int slot);
-enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *buf);
-enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *buf);
+enum btrfs_tree_block_status btrfs_check_node(struct extent_buffer *buf);
+enum btrfs_tree_block_status btrfs_check_leaf(struct extent_buffer *buf);
 void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
 		      int level, int slot, u64 objectid);
 struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index b5ad89c2..7d165720 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -389,9 +389,9 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
 			 * btrfs ins dump-tree.
 			 */
 			if (btrfs_header_level(eb))
-				ret = btrfs_check_node(NULL, eb);
+				ret = btrfs_check_node(eb);
 			else
-				ret = btrfs_check_leaf(NULL, eb);
+				ret = btrfs_check_leaf(eb);
 			if (!ret || candidate_mirror == mirror_num) {
 				btrfs_set_buffer_uptodate(eb);
 				return eb;
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 06/11] btrfs-progs: remove the _on() related message helpers
  2023-04-19 21:13 ` [PATCH 06/11] btrfs-progs: remove the _on() related message helpers Josef Bacik
@ 2023-05-02 20:35   ` David Sterba
  0 siblings, 0 replies; 14+ messages in thread
From: David Sterba @ 2023-05-02 20:35 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Apr 19, 2023 at 05:13:48PM -0400, Josef Bacik wrote:
>  #define error_on(cond, fmt, ...)					\
>  	do {								\
> -		if ((cond))						\
> +		if ((cond)) {						\
>  			PRINT_TRACE_ON_ERROR;				\
> -		if ((cond))						\
>  			PRINT_VERBOSE_ERROR;				\
> -		__btrfs_error_on((cond), (fmt), ##__VA_ARGS__);		\
> -		if ((cond))						\
> -			DO_ABORT_ON_ERROR;				\

The DO_ABORT_ON_ERROR got accidentally dropped, it should be there as
it's how 'make D=abort' is implemented.

> +			__btrfs_error((fmt), ##__VA_ARGS__);		\
> +		}							\
>  	} while (0)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared
  2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
                   ` (10 preceding siblings ...)
  2023-04-19 21:13 ` [PATCH 11/11] btrfs-progs: remove parent_key arg from btrfs_check_* helpers Josef Bacik
@ 2023-05-02 20:56 ` David Sterba
  11 siblings, 0 replies; 14+ messages in thread
From: David Sterba @ 2023-05-02 20:56 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Apr 19, 2023 at 05:13:42PM -0400, Josef Bacik wrote:
> Hello,
> 
> These a variety of fixes, cleanups, and api changes to make it easier to sync
> recent kernel changes into btrfs-progs.  They're relatively straightforward, and
> have been run through the tests.  Thanks,
> 
> Josef
> 
> Josef Bacik (11):
>   btrfs-progs: fix kerncompat.h include ordering for libbtrfs
>   btrfs-progs: use $SUDO_HELPER in convert tests for temp files
>   btrfs-progs: re-add __init to include/kerncompat.h
>   btrfs-progs: introduce UASSERT() for purely userspace code
>   btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace
>   btrfs-progs: remove the _on() related message helpers
>   btrfs-progs: consolidate the btrfs message helpers
>   btrfs-progs: rename the qgroup structs to match the kernel
>   btrfs-progs: remove fs_info argument from btrfs_check_* helpers
>   btrfs-progs: add a btrfs check helper for checking blocks
>   btrfs-progs: remove parent_key arg from btrfs_check_* helpers

Added to devel, with some minor adjustments, thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-02 21:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 21:13 [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared Josef Bacik
2023-04-19 21:13 ` [PATCH 01/11] btrfs-progs: fix kerncompat.h include ordering for libbtrfs Josef Bacik
2023-04-19 21:13 ` [PATCH 02/11] btrfs-progs: use $SUDO_HELPER in convert tests for temp files Josef Bacik
2023-04-19 21:13 ` [PATCH 03/11] btrfs-progs: re-add __init to include/kerncompat.h Josef Bacik
2023-04-19 21:13 ` [PATCH 04/11] btrfs-progs: introduce UASSERT() for purely userspace code Josef Bacik
2023-04-19 21:13 ` [PATCH 05/11] btrfs-progs: move BTRFS_DISABLE_BACKTRACE check in print_trace Josef Bacik
2023-04-19 21:13 ` [PATCH 06/11] btrfs-progs: remove the _on() related message helpers Josef Bacik
2023-05-02 20:35   ` David Sterba
2023-04-19 21:13 ` [PATCH 07/11] btrfs-progs: consolidate the btrfs " Josef Bacik
2023-04-19 21:13 ` [PATCH 08/11] btrfs-progs: rename the qgroup structs to match the kernel Josef Bacik
2023-04-19 21:13 ` [PATCH 09/11] btrfs-progs: remove fs_info argument from btrfs_check_* helpers Josef Bacik
2023-04-19 21:13 ` [PATCH 10/11] btrfs-progs: add a btrfs check helper for checking blocks Josef Bacik
2023-04-19 21:13 ` [PATCH 11/11] btrfs-progs: remove parent_key arg from btrfs_check_* helpers Josef Bacik
2023-05-02 20:56 ` [PATCH 00/11] btrfs-progs: prep work for syncing files into kernel-shared David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.