]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
blkid: Fix probing logic so we find renamed devices
authorTheodore Ts'o <tytso@mit.edu>
Sun, 10 Aug 2008 02:37:58 +0000 (22:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 10 Aug 2008 02:37:58 +0000 (22:37 -0400)
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

lib/blkid/devname.c

index 65c6ccae8afcaef90f211e8e32b4830d5122279a..89b33f2141c0180e651f73affa811efe410bc7f6 100644 (file)
@@ -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)