diff options
author | Hannes Reinecke | 2014-03-20 11:03:50 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-20 15:26:48 +0100 |
commit | 37f4060225df0591ab8e1dd676dbc8115d900d4f (patch) | |
tree | 47b445e8868687025b4769ada1824a5bdd2e8b8e /libblkid/src/superblocks/drbd.c | |
parent | blkid: stop scanning on I/O error (diff) | |
download | kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.tar.gz kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.tar.xz kernel-qcow2-util-linux-37f4060225df0591ab8e1dd676dbc8115d900d4f.zip |
blkid: convert superblocks to new calling convention
With the previous patch the scanning functions were
modified to return a differentiated return code.
To correctly abort scanning when an I/O error occurs
we need to differentiate between 'error' (= -1) and
'not found' (= 1) in the probe functions.
This patch updates all superblock scanning functions
to the new calling convention.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/superblocks/drbd.c')
-rw-r--r-- | libblkid/src/superblocks/drbd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libblkid/src/superblocks/drbd.c b/libblkid/src/superblocks/drbd.c index 43e544e89..e88e9f353 100644 --- a/libblkid/src/superblocks/drbd.c +++ b/libblkid/src/superblocks/drbd.c @@ -75,18 +75,18 @@ static int probe_drbd(blkid_probe pr, /* Small devices cannot be drbd (?) */ if (pr->size < 0x10000) - return -1; + return 1; md = (struct md_on_disk_08 *) blkid_probe_get_buffer(pr, off, sizeof(struct md_on_disk_08)); if (!md) - return -1; + return errno ? -errno : 1; if (be32_to_cpu(md->magic) != DRBD_MD_MAGIC_08 && be32_to_cpu(md->magic) != DRBD_MD_MAGIC_84_UNCLEAN) - return -1; + return 1; /* * DRBD does not have "real" uuids; the following resembles DRBD's @@ -102,7 +102,7 @@ static int probe_drbd(blkid_probe pr, off + offsetof(struct md_on_disk_08, magic), sizeof(md->magic), (unsigned char *) &md->magic)) - return -1; + return 1; return 0; } |