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 4EA123D5661 for ; Fri, 15 May 2026 12:06:18 +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=1778846778; cv=none; b=MUBx3BQYzAV6q79H8Sn7z4rEpTKIcgAqSEQraM0kIT0/xFhwUyDHsEywORu1cnwTLg8VQ3BFZTTNYOEL53uq7UtAR7OYTv9UBAIXgwmnu+lF2Q/LEBd59nNJOuItkHbnQ0zb+nQgxC2Bn5w0L6UeG7ZX4QcOlWXMfD8f3AdX1GE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778846778; c=relaxed/simple; bh=FpQWMMS8S0Y4Z5OgrisPgmdLEnHpQy8/oAI4buubK/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DWYukUwb/OnXdBcn4ZrvB9tHoFh/9jPmqQX5OlTui7GYou+2ydjJIjd0RhY79TdZCXprA3WFeFpNrIlBuuvNllaDt4u85b8mqCfgV2OLAHnOBJ8OWv0YeB107vONSIexHQhnNl+V2NatmKaD0JrG6kyIVppm7MpWKtXaUjqTO54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gFVACP36; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gFVACP36" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59258C2BCB0; Fri, 15 May 2026 12:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778846778; bh=FpQWMMS8S0Y4Z5OgrisPgmdLEnHpQy8/oAI4buubK/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gFVACP36Srk10DiUQmYeylxYXzpmEpkhkjvFySAF8qx++wPWy1nDTkVj0QOaAoq42 Rh/RbQ1RQ+lh6anchRV+HmZ1BusllUdxj+5Q6qs39CHfTh60aGQCReoBUnkd1NBGfo Pzrk0UZoXTF6sYIJ2jgo9Ln0evgACJILnRSdM+n7tUQgy2B1PSNuGaV+2UV9g98z+k Il5kLJ/iLLDgJnJJa0/k+bhMyEwIaSwvp6MmTsU79ijGEtR11vKF0e17nMNcF1L0Cj EH7theQ4EaszzkXTrsuJsdCSjcmPX9w6bxofd9B7KHr9WgWBtf7OP4tcx4EJEJI2lr HIK6mBT1Ri1Bw== From: Sasha Levin To: stable@vger.kernel.org Cc: Filipe Manana , Johannes Thumshirn , David Sterba , Sasha Levin Subject: [PATCH 6.18.y 1/2] btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type() Date: Fri, 15 May 2026 08:06:14 -0400 Message-ID: <20260515120615.3073340-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051234-decidable-catalyst-a4ae@gregkh> References: <2026051234-decidable-catalyst-a4ae@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- fs/btrfs/space-info.c | 4 ++-- fs/btrfs/sysfs.c | 5 ++--- fs/btrfs/sysfs.h | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index a815308e2db91..c4a50550672da 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -275,7 +275,7 @@ static int create_space_info_sub_group(struct btrfs_space_info *parent, u64 flag 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; @@ -309,7 +309,7 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags) 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; diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 81f52c1f55ce5..d66681ce2b3da 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1981,13 +1981,12 @@ static const char *alloc_name(struct btrfs_space_info *space_info) * 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); diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h index 0f94ae9232101..05498e5346c39 100644 --- a/fs/btrfs/sysfs.h +++ b/fs/btrfs/sysfs.h @@ -37,8 +37,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); -- 2.53.0