Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exFAT superblock not probed #119

Closed
lethean opened this issue Sep 5, 2014 · 0 comments
Closed

exFAT superblock not probed #119

lethean opened this issue Sep 5, 2014 · 0 comments

Comments

@lethean
Copy link

lethean commented Sep 5, 2014

After commit 37f4060225df0591ab8e1dd676dbc8115d900d4f, exFAT filesystem is not probed by blkid.

commit 37f4060225df0591ab8e1dd676dbc8115d900d4f
Author: Hannes Reinecke <hare@suse.de>
Date:   Thu Mar 20 11:03:50 2014 +0100

    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>

When I revert some code, it probes exFAT disk properly like:

$ blkid
/dev/sdd1: UUID="3402-0CBC" TYPE="exfat" PARTUUID="be580595-01" 

Following is my patch.

From 68dec3b54fc1538a0048caf8cc2df9d4f9ae07b1 Mon Sep 17 00:00:00 2001
From: Sunjin Yang <fan4326@gmail.com>
Date: Fri, 5 Sep 2014 14:32:26 +0900
Subject: [PATCH] blkid: fix exFAT superblock not probed

---
 libblkid/src/superblocks/exfat.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c
index b526560..b1173b8 100644
--- a/libblkid/src/superblocks/exfat.c
+++ b/libblkid/src/superblocks/exfat.c
@@ -121,8 +121,6 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
    if (label)
        blkid_probe_set_utf8label(pr, label->name,
                min(label->length * 2, 30), BLKID_ENC_UTF16LE);
-   else if (errno)
-       return -errno;

    blkid_probe_sprintf_uuid(pr, sb->volume_serial, 4,
            "%02hhX%02hhX-%02hhX%02hhX",
-- 
2.1.0

I don't know that this is a correct patch, but it works.

Any suggestion or idea?

karelzak added a commit that referenced this issue Oct 7, 2014
Since 37f4060 prober functions are
sensitive to errno, it seems more robust to set errno=0 with in
blkid_probe_get_buffer() on success than set the zero on all places
where we call blkid_probe_get_buffer().

Addresses: #119
Signed-off-by: Karel Zak <kzak@redhat.com>
@karelzak karelzak closed this as completed Oct 7, 2014
karelzak added a commit that referenced this issue Oct 24, 2014
Since 37f4060 prober functions are
sensitive to errno, it seems more robust to set errno=0 with in
blkid_probe_get_buffer() on success than set the zero on all places
where we call blkid_probe_get_buffer().

Addresses: #119
Signed-off-by: Karel Zak <kzak@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants