f2fs-toos: fsck.f2fs Fix bad return value

commit ca0ed8a66f
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

'ret' should not have been used here: otherwise, it would be wrongly used
as the error code and then be returned from main().

Signed-off-by: Robin Hsu <robinhsu@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Robin Hsu 2020-10-26 17:40:00 +08:00 committed by dongsenhao
parent 061536fa27
commit ad9ff71f6f

View File

@ -3146,10 +3146,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
#ifndef WITH_ANDROID
if (nr_unref_nid && !c.ro) {
char ans[255] = {0};
int res;
printf("\nDo you want to restore lost files into ./lost_found/? [Y/N] ");
ret = scanf("%s", ans);
ASSERT(ret >= 0);
res = scanf("%s", ans);
ASSERT(res >= 0);
if (!strcasecmp(ans, "y")) {
for (i = 0; i < fsck->nr_nat_entries; i++) {
if (f2fs_test_bit(i, fsck->nat_area_bitmap))