From: Anand Jain Date: Thu, 25 Jul 2013 17:35:30 +0000 (+0800) Subject: btrfs-progs: don't have to report ENOMEDIUM error during open X-Git-Tag: upstream/4.16.1~3204 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c1725a07b384e13300b99ecf6816b6f78615691;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: don't have to report ENOMEDIUM error during open when we scan /proc/partitions the cdrom is scanned as well, and we don't have to report ENOMEDIUM errors against it. Signed-off-by: Anand Jain Signed-off-by: David Sterba Signed-off-by: Chris Mason --- diff --git a/utils.c b/utils.c index 46f502d..6b4c4a7 100644 --- a/utils.c +++ b/utils.c @@ -1438,8 +1438,9 @@ scan_again: fd = open(fullpath, O_RDONLY); if (fd < 0) { - fprintf(stderr, "failed to open %s: %s\n", - fullpath, strerror(errno)); + if (errno != ENOMEDIUM) + fprintf(stderr, "failed to open %s: %s\n", + fullpath, strerror(errno)); continue; } ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,