mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-04 11:51:42 +00:00
btrfs-progs: adjust the return values for scrub
o Return 0 to indicate success, when detected errors were corrected during scrubbing. P.s. This is also to facilitate scripting when return value is to be checked. o Warn the users if there are uncorrectable errors detected. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
f3936db37a
commit
965cd86449
13
cmds-scrub.c
13
cmds-scrub.c
@ -1514,14 +1514,17 @@ out:
|
||||
}
|
||||
close_file_or_dir(fdmnt, dirstream);
|
||||
|
||||
if (nothing_to_resume)
|
||||
return 2;
|
||||
if (err)
|
||||
return 1;
|
||||
if (e_correctable)
|
||||
if (nothing_to_resume)
|
||||
return 2;
|
||||
if (e_uncorrectable) {
|
||||
ERR(!do_quiet, "ERROR: There are uncorrectable errors.\n");
|
||||
return 3;
|
||||
if (e_uncorrectable)
|
||||
return 4;
|
||||
}
|
||||
if (e_correctable)
|
||||
ERR(!do_quiet, "WARNING: errors detected during scrubbing, corrected.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user