linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: Fix an error handling path in btrfs_read_sys_array()
@ 2022-05-14 12:01 Christophe JAILLET
  2022-05-14 22:57 ` Qu Wenruo
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe JAILLET @ 2022-05-14 12:01 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, Qu Wenruo
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-btrfs

If alloc_dummy_extent_buffer() we should return an error code, not 0 that
would mean success.

Fixes: a1fc41ac28d3 ("btrfs: use dummy extent buffer for super block sys chunk array read")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b2d5a54ea172..9c20049d1fec 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -7359,7 +7359,7 @@ int btrfs_read_sys_array(struct btrfs_fs_info *fs_info)
 	 */
 	sb = alloc_dummy_extent_buffer(fs_info, BTRFS_SUPER_INFO_OFFSET);
 	if (!sb)
-		return PTR_ERR(sb);
+		return -ENOMEM;
 	set_extent_buffer_uptodate(sb);
 
 	write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE);
-- 
2.34.1


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

end of thread, other threads:[~2022-05-17  5:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14 12:01 [PATCH] btrfs: Fix an error handling path in btrfs_read_sys_array() Christophe JAILLET
2022-05-14 22:57 ` Qu Wenruo
2022-05-16 13:54   ` Dan Carpenter
2022-05-16 15:01     ` David Sterba
2022-05-16 17:42       ` Christophe JAILLET
2022-05-17  5:55         ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).