From: Theodore Ts'o Date: Sun, 10 Feb 2008 03:30:20 +0000 (-0500) Subject: blkid: Flush cached filesystem information on any error other than EPERM X-Git-Tag: v1.40.6~6 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=838f133c72a583eae67414368e46ee0303e0a51f;p=tools%2Fe2fsprogs.git blkid: Flush cached filesystem information on any error other than EPERM USB devices can return ENOMEDIUM, and when the filesystem cached information wasn't flushed, it resulted in the wrong location of a filesystem to be returned to the caller. The only justification for using cached information when the open fails is in the case of a permission denied error. Addresses-Debian-Bug: #463787 --- diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index e87c0b9..917447b 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -1155,7 +1155,7 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) if (((probe.fd = open(dev->bid_name, O_RDONLY)) < 0) || (fstat(probe.fd, &st) < 0)) { if (probe.fd >= 0) close(probe.fd); - if (errno == ENXIO || errno == ENODEV || errno == ENOENT) { + if (errno != EPERM) { blkid_free_dev(dev); return NULL; }