From: Theodore Ts'o Date: Sun, 10 Aug 2008 02:37:58 +0000 (-0400) Subject: blkid: Fix probing logic so we find renamed devices X-Git-Tag: v1.41.1~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=57926c8c5566f0ef5b77db326d58aa0643cf6270;p=thirdparty%2Fe2fsprogs.git blkid: Fix probing logic so we find renamed devices This fixes a bug where if there is an entry in the /etc/blkid.tab file for a particular device (major, minor) number but the filename does not exist, blkid wouldn't try to find the correct filename. Addresses-Debian-Bug: #493216 --- diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c index 65c6ccae8..89b33f214 100644 --- a/lib/blkid/devname.c +++ b/lib/blkid/devname.c @@ -142,10 +142,12 @@ static void probe_one(blkid_cache cache, const char *ptname, continue; #endif if (tmp->bid_devno == devno) { - if (only_if_new) + if (only_if_new && !access(tmp->bid_name, F_OK)) return; dev = blkid_verify(cache, tmp); - break; + if (dev && (dev->bid_flags & BLKID_BID_FL_VERIFIED)) + break; + dev = 0; } } if (dev && dev->bid_devno == devno)