[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210305094353.13511-1-baijiaju1990@gmail.com>
Date: Fri, 5 Mar 2021 01:43:53 -0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: clm@...com, josef@...icpanda.com, dsterba@...e.com
Cc: linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] fs: btrfs: fix error return code of btrfs_recover_relocation()
When the list of reloc_roots is empty, no error return code of
btrfs_recover_relocation() is assigned.
To fix this bug, err is assigned with -ENOENT as error return code.
Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
fs/btrfs/relocation.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 232d5da7b7be..631b672a852f 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3817,8 +3817,10 @@ int btrfs_recover_relocation(struct btrfs_root *root)
}
btrfs_release_path(path);
- if (list_empty(&reloc_roots))
+ if (list_empty(&reloc_roots)) {
+ err = -ENOENT;
goto out;
+ }
rc = alloc_reloc_control(fs_info);
if (!rc) {
--
2.17.1
Powered by blists - more mailing lists