[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <d915ceb4d459aff89c0264113db21592a6806db1.1652517184.git.christophe.jaillet@wanadoo.fr>
Date: Sat, 14 May 2022 14:01:29 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>, Qu Wenruo <wqu@...e.com>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-btrfs@...r.kernel.org
Subject: [PATCH] btrfs: Fix an error handling path in btrfs_read_sys_array()
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@...adoo.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
Powered by blists - more mailing lists