From: David Shea <dshea@redhat.com>
To: util-linux@vger.kernel.org
Subject: [PATCH] Correct the return values in squashfs probe
Date: Mon, 23 Jun 2014 13:41:48 -0400 [thread overview]
Message-ID: <1403545308-18371-1-git-send-email-dshea@redhat.com> (raw)
Returning -1 can cause squashfs v3 detection to make v4 detection fail.
---
libblkid/src/superblocks/squashfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libblkid/src/superblocks/squashfs.c b/libblkid/src/superblocks/squashfs.c
index a35d60f..c8f9641 100644
--- a/libblkid/src/superblocks/squashfs.c
+++ b/libblkid/src/superblocks/squashfs.c
@@ -41,7 +41,7 @@ static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag)
major = le16_to_cpu(sq->s_major);
minor = le16_to_cpu(sq->s_minor);
if (major < 4)
- return -1;
+ return 1;
blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
@@ -56,7 +56,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
if (!sq)
- return -1;
+ return 1;
if (strcmp(mag->magic, "sqsh") == 0) {
major = be16_to_cpu(sq->s_major);
@@ -67,7 +67,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
}
if (major > 3)
- return -1;
+ return 1;
blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
--
2.0.0
next reply other threads:[~2014-06-23 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 17:41 David Shea [this message]
2014-06-24 8:56 ` [PATCH] Correct the return values in squashfs probe Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403545308-18371-1-git-send-email-dshea@redhat.com \
--to=dshea@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox