chiark / gitweb /
bus-proxy: ECONNRESET/ENOTCONN can hit us on every step, hence handle it on every...
[elogind.git] / src / udev / udev-builtin-blkid.c
index 810f27d1d0c5532218633d79f3d9467bf2d45e85..03e3dc2867bd814de876e8e142da1b80e469cc53 100644 (file)
@@ -221,6 +221,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
         blkid_probe pr;
         const char *data;
         const char *name;
+        const char *prtype = NULL;
         int nvals;
         int i;
         int err = 0;
@@ -256,7 +257,8 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
         blkid_probe_set_superblocks_flags(pr,
                 BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
                 BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE |
-                BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION);
+                BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION |
+                BLKID_SUBLKS_BADCSUM);
 
         if (noraid)
                 blkid_probe_filter_superblocks_usage(pr, BLKID_FLTR_NOTIN, BLKID_USAGE_RAID);
@@ -271,13 +273,22 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
         if (err < 0)
                 goto out;
 
-        log_debug("probe %s %sraid offset=%"PRIu64,
+        log_debug("probe %s %sraid offset=%"PRIi64,
                   udev_device_get_devnode(dev),
                   noraid ? "no" : "", offset);
 
         err = probe_superblocks(pr);
         if (err < 0)
                 goto out;
+        if (blkid_probe_has_value(pr, "SBBADCSUM")) {
+                if (!blkid_probe_lookup_value(pr, "TYPE", &prtype, NULL))
+                        log_warning("incorrect %s checksum on %s",
+                                    prtype, udev_device_get_devnode(dev));
+                else
+                        log_warning("incorrect checksum on %s",
+                                    udev_device_get_devnode(dev));
+                goto out;
+        }
 
         /* If we are a partition then our parent passed on the root
          * partition UUID to us */
@@ -314,6 +325,6 @@ out:
 const struct udev_builtin udev_builtin_blkid = {
         .name = "blkid",
         .cmd = builtin_blkid,
-        .help = "filesystem and partition probing",
+        .help = "Filesystem and partition probing",
         .run_once = true,
 };