summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Perthuis <g2p.code@gmail.com>2014-12-17 14:37:25 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-12-17 14:37:25 -0500
commitc93ec252df0a0a0bb499031f92b240063e17fc12 (patch)
tree2c7308db53345b57f29383c936c9ef1fda09dfd0
parent411ec4713bc70f051e87c8f095de07cade417b09 (diff)
blkid: Warn when rejecting a superblock with a bad csum
Bump libblkid requirement from 2.20 to 2.24. util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/udev/udev-builtin-blkid.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
index f97f516462..cf910a0b3a 100644
--- a/src/udev/udev-builtin-blkid.c
+++ b/src/udev/udev-builtin-blkid.c
@@ -138,6 +138,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;
@@ -172,7 +173,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);
@@ -194,6 +196,15 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
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;
+ }
nvals = blkid_probe_numof_values(pr);
for (i = 0; i < nvals; i++) {