Skip to contentSkip to conversation

FAILED: patch "[PATCH] btrfs: tracepoints: Fix wrong parameter order for qgroup" failed to apply to 4.19-stable tree

PATCH [email protected] 3 participants 3 messages Oct 27, 2019 – Oct 29, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From fd2b007eaec898564e269d1f478a2da0380ecf51 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <[email protected]>
Date: Thu, 17 Oct 2019 10:38:36 +0800
Subject: [PATCH] btrfs: tracepoints: Fix wrong parameter order for qgroup
events

[BUG]
For btrfs:qgroup_meta_reserve event, the trace event can output garbage:

qgroup_meta_reserve: 9c7f6acc-b342-4037-bc47-7f6e4d2232d7: refroot=5(FS_TREE) type=DATA diff=2

The diff should always be alinged to sector size (4k), so there is definitely something wrong.

[CAUSE]
For the wrong @diff, it's caused by wrong parameter order. The correct parameters are:

struct btrfs_root, s64 diff, int type.

However the parameters used are:

struct btrfs_root, int type, s64 diff.

Fixes 4ee0d8832c2e ("btrfs: qgroup: Update trace events for metadata reservation")
fs/btrfs/qgroup.c +2 -2
index c4bb69941c77..3ad151655eb8 100644
@@ -3629,7 +3629,7 @@ int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
 		return 0;
 
 	BUG_ON(num_bytes != round_down(num_bytes, fs_info->nodesize));
-	trace_qgroup_meta_reserve(root, type, (s64)num_bytes);
+	trace_qgroup_meta_reserve(root, (s64)num_bytes, type);
 	ret = qgroup_reserve(root, num_bytes, enforce, type);
 	if (ret < 0)
 		return ret;
@@ -3676,7 +3676,7 @@ void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes,
 	 */
 	num_bytes = sub_root_meta_rsv(root, num_bytes, type);
 	BUG_ON(num_bytes != round_down(num_bytes, fs_info->nodesize));
-	trace_qgroup_meta_reserve(root, type, -(s64)num_bytes);
+	trace_qgroup_meta_reserve(root, -(s64)num_bytes, type);
 	btrfs_qgroup_free_refroot(fs_info, root->root_key.objectid,
 				  num_bytes, type);
 }
maintainer
#1 lore raw
Quoted 34 lines · On Sun, Oct 27, 2019 at 04:48:16PM +0100, [email protected] wrote:

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From fd2b007eaec898564e269d1f478a2da0380ecf51 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <[email protected]>
Date: Thu, 17 Oct 2019 10:38:36 +0800
Subject: [PATCH] btrfs: tracepoints: Fix wrong parameter order for qgroup events

[BUG]
For btrfs:qgroup_meta_reserve event, the trace event can output garbage:

qgroup_meta_reserve: 9c7f6acc-b342-4037-bc47-7f6e4d2232d7: refroot=5(FS_TREE) type=DATA diff=2

The diff should always be alinged to sector size (4k), so there is definitely something wrong.

[CAUSE]
For the wrong @diff, it's caused by wrong parameter order. The correct parameters are:

struct btrfs_root, s64 diff, int type.

However the parameters used are:

Quoted 8 lines

struct btrfs_root, int type, s64 diff.

Fixes 4ee0d8832c2e ("btrfs: qgroup: Update trace events for metadata reservation")

Just needed some love to work around missing 4fd786e6c3d67 ("btrfs:
Remove 'objectid' member from struct btrfs_root"). Queued up for 4.19.

Signature · 2 lines
Thanks,
Sasha
#2 lore raw
Quoted 46 lines · Sasha Levin
Quoted 37 lines · On Sun, Oct 27, 2019 at 04:48:16PM +0100, [email protected] wrote:

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From fd2b007eaec898564e269d1f478a2da0380ecf51 Mon Sep 17 00:00:00 2001
From: Qu Wenruo <[email protected]>
Date: Thu, 17 Oct 2019 10:38:36 +0800
Subject: [PATCH] btrfs: tracepoints: Fix wrong parameter order for qgroup events

[BUG]
For btrfs:qgroup_meta_reserve event, the trace event can output garbage:

 qgroup_meta_reserve: 9c7f6acc-b342-4037-bc47-7f6e4d2232d7:
refroot=5(FS_TREE) type=DATA diff=2

The diff should always be alinged to sector size (4k), so there is definitely something wrong.

[CAUSE]
For the wrong @diff, it's caused by wrong parameter order. The correct parameters are:

 struct btrfs_root, s64 diff, int type.

However the parameters used are:

 struct btrfs_root, int type, s64 diff.

Quoted 7 lines
Fixes 4ee0d8832c2e ("btrfs: qgroup: Update trace events for metadata

reservation")

Quoted 3 lines

Just needed some love to work around missing 4fd786e6c3d67 ("btrfs:
Remove 'objectid' member from struct btrfs_root"). Queued up for 4.19.

AFAIK I just sent out the fixed patches for 4.19 and 5.3 branches.

Thanks,
Qu