mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-23 07:25:20 +00:00
btrfs-progs: fix wrong error msg for exec btrfsck as non-root
When exec btrfsck as non-root user on a disk, btrfsck will always warn that "No such file or directory", despite that a directory (e.g. /dev/vboxusb)actually exists. We just have no permission. In this case, return the -errno set by the opendir call in btrfs_scan_one_dir rather than blindly return -ENOENT. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
51a40f6df0
commit
002d5e1430
2
utils.c
2
utils.c
@ -1111,7 +1111,7 @@ again:
|
|||||||
dirp = opendir(dirname);
|
dirp = opendir(dirname);
|
||||||
if (!dirp) {
|
if (!dirp) {
|
||||||
fprintf(stderr, "Unable to open %s for scanning\n", dirname);
|
fprintf(stderr, "Unable to open %s for scanning\n", dirname);
|
||||||
ret = -ENOENT;
|
ret = -errno;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
while(1) {
|
while(1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user