[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_B5B404449776B76666D7B36B03644962A305@qq.com>
Date: Mon, 8 Dec 2025 18:50:16 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+b44d4a4885bc82af2a06@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [btrfs?] kernel BUG in btrfs_qgroup_inherit
#syz test
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 9e2b53e90dcb..ac5380520152 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -3289,10 +3289,6 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
if (!btrfs_qgroup_enabled(fs_info))
return 0;
- prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
- if (!prealloc)
- return -ENOMEM;
-
/*
* There are only two callers of this function.
*
@@ -3388,6 +3384,12 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid,
}
}
+ prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
+ if (!prealloc) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
spin_lock(&fs_info->qgroup_lock);
dstgroup = add_qgroup_rb(fs_info, prealloc, objectid);
Powered by blists - more mailing lists