]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: ignore the case that the device is already removed
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Jun 2021 10:10:49 +0000 (19:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Jun 2021 10:10:52 +0000 (19:10 +0900)
See #19788.

src/udev/udev-builtin-blkid.c

index 2daafb115054ecc8e5463e51691a14f0e647dcdf..cfb74b9cf8e7fdfabd29bac4d6b2e40fedae5dfa 100644 (file)
@@ -298,8 +298,11 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
                 return log_device_debug_errno(dev, r, "Failed to get device name: %m");
 
         fd = open(devnode, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
-        if (fd < 0)
-                return log_device_debug_errno(dev, errno, "Failed to open block device %s: %m", devnode);
+        if (fd < 0) {
+                log_device_debug_errno(dev, errno, "Failed to open block device %s%s: %m",
+                                       devnode, errno == ENOENT ? ", ignoring" : "");
+                return errno == ENOENT ? 0 : -errno;
+        }
 
         errno = 0;
         r = blkid_probe_set_device(pr, fd, offset, 0);