From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BACBA17C220; Fri, 15 May 2026 15:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860549; cv=none; b=auzVbR2OAEFvwcBO2xm9GnLXYwI38bN1HQkoPrX7CAkoiY9YE80YViAPfJxKAZFS8E8G61C/XN0opMpujFTst+wAF5Tc8Vx6HGKeK4o0kDVBIBf+jbPYozP8vk5HmG+//u8+HNSGrejwLTi8rOB4ZlQhhLVmEoryhrXMaT6VsnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860549; c=relaxed/simple; bh=fnYHGYmVW/cedA+41LynG5CvS5Q84bKOEQ6XOb4lWYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KpAke3Fv+gwjBsheUy8IWje6+dOv5N/liCZu5jhDImFbWymOD8DcABgcSdwePvWJhB0wCnAAnIk8jajgbJf9ZDu20zQ1yDS+wSL+elYQl825aZYyZt3DyuVtIj1b3ANUpJpXFlt5pfGY9t36zLy95FAIh9XfNqRXx80wM+eIyJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qFxSrumh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qFxSrumh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ED4CC2BCC7; Fri, 15 May 2026 15:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778860549; bh=fnYHGYmVW/cedA+41LynG5CvS5Q84bKOEQ6XOb4lWYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qFxSrumhkhad6fobXdrijQhlElZQL1FoWZNt7gtnP/E5zgcwdIxvDDgMl8CTftC0c e1M7bcLLs0aujFDyRlTaKI3r8+Cypd4q7s3lRNz0Z6m1Zvj7ZV7WjMW+Lx0nMgaED/ BqEglhSDAqPJrbbvjDUfD5t09KRiUYsV9BFSkKHg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Johannes Thumshirn , Filipe Manana , David Sterba , Sasha Levin Subject: [PATCH 6.12 132/144] btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type() Date: Fri, 15 May 2026 17:49:18 +0200 Message-ID: <20260515154656.577025122@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154653.469907118@linuxfoundation.org> References: <20260515154653.469907118@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Filipe Manana [ Upstream commit 771af6ff72e0ed0eb8bf97e5ae4fa5094e0c5d1d ] We don't need it since we can grab fs_info from the given space_info. So remove the fs_info argument. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Stable-dep-of: a7449edf9614 ("btrfs: fix double free in create_space_info_sub_group() error path") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/space-info.c | 4 ++-- fs/btrfs/sysfs.c | 5 ++--- fs/btrfs/sysfs.h | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -265,7 +265,7 @@ static int create_space_info_sub_group(s sub_group->parent = parent; sub_group->subgroup_id = id; - ret = btrfs_sysfs_add_space_info_type(fs_info, sub_group); + ret = btrfs_sysfs_add_space_info_type(sub_group); if (ret) { kfree(sub_group); parent->sub_group[index] = NULL; @@ -294,7 +294,7 @@ static int create_space_info(struct btrf goto out_free; } - ret = btrfs_sysfs_add_space_info_type(info, space_info); + ret = btrfs_sysfs_add_space_info_type(space_info); if (ret) return ret; --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1825,13 +1825,12 @@ static const char *alloc_name(struct btr * Create a sysfs entry for a space info type at path * /sys/fs/btrfs/UUID/allocation/TYPE */ -int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info, - struct btrfs_space_info *space_info) +int btrfs_sysfs_add_space_info_type(struct btrfs_space_info *space_info) { int ret; ret = kobject_init_and_add(&space_info->kobj, &space_info_ktype, - fs_info->space_info_kobj, "%s", + space_info->fs_info->space_info_kobj, "%s", alloc_name(space_info)); if (ret) { kobject_put(&space_info->kobj); --- a/fs/btrfs/sysfs.h +++ b/fs/btrfs/sysfs.h @@ -36,8 +36,7 @@ void __cold btrfs_exit_sysfs(void); int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info); void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info); void btrfs_sysfs_add_block_group_type(struct btrfs_block_group *cache); -int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info, - struct btrfs_space_info *space_info); +int btrfs_sysfs_add_space_info_type(struct btrfs_space_info *space_info); void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info); void btrfs_sysfs_update_devid(struct btrfs_device *device);