From 838f133c72a583eae67414368e46ee0303e0a51f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 9 Feb 2008 22:30:20 -0500 Subject: [PATCH] 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 --- lib/blkid/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 1.8.3.1