* [PATCH] Correct the return values in squashfs probe
@ 2014-06-23 17:41 David Shea
2014-06-24 8:56 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: David Shea @ 2014-06-23 17:41 UTC (permalink / raw)
To: util-linux
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Correct the return values in squashfs probe
2014-06-23 17:41 [PATCH] Correct the return values in squashfs probe David Shea
@ 2014-06-24 8:56 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-06-24 8:56 UTC (permalink / raw)
To: David Shea; +Cc: util-linux
On Mon, Jun 23, 2014 at 01:41:48PM -0400, David Shea wrote:
> libblkid/src/superblocks/squashfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
> sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
> if (!sq)
> - return -1;
> + return 1;
Note that the current libblkid code is sensitive to IO errors, so the
correct changes is
return errno ? -errno : 1;
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-24 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 17:41 [PATCH] Correct the return values in squashfs probe David Shea
2014-06-24 8:56 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox