From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: util-linux@vger.kernel.org
Subject: [PATCH] Accept small blocks for NTFS and Reiserfs in blkid
Date: Thu, 03 May 2012 14:16:07 +0200 [thread overview]
Message-ID: <4FA27707.4090608@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 301 bytes --]
libblkid is restrictive as to what it accepts as valid reiserfs or valid
NTFS.
One can mkfs an NTFS with 256B sectors and it's supported by ntfs-3g
Reiserfs can have 512B blocks and it works both with mkfs.ntfs and Linux.
Patch attached.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: block.diff --]
[-- Type: text/x-diff; name="block.diff", Size: 1496 bytes --]
diff -ur util-linux-2.20.1/libblkid/src/superblocks/ntfs.c util-linux-2.20.1-mod/libblkid/src/superblocks/ntfs.c
--- util-linux-2.20.1/libblkid/src/superblocks/ntfs.c 2011-09-26 11:50:23.000000000 +0200
+++ util-linux-2.20.1-mod/libblkid/src/superblocks/ntfs.c 2012-05-03 14:07:35.193438515 +0200
@@ -81,7 +81,7 @@
(ns->bios_parameter_block[1] << 8);
sectors_per_cluster = ns->bios_parameter_block[2];
- if ((bytes_per_sector < 512) || (sectors_per_cluster == 0))
+ if ((bytes_per_sector < 256) || (sectors_per_cluster == 0))
return 1;
if (ns->cluster_per_mft_record < 0)
diff -ur util-linux-2.20.1/libblkid/src/superblocks/reiserfs.c util-linux-2.20.1-mod/libblkid/src/superblocks/reiserfs.c
--- util-linux-2.20.1/libblkid/src/superblocks/reiserfs.c 2011-09-26 11:50:23.000000000 +0200
+++ util-linux-2.20.1-mod/libblkid/src/superblocks/reiserfs.c 2012-05-03 14:08:29.636647756 +0200
@@ -49,12 +49,12 @@
blocksize = le16_to_cpu(rs->rs_blocksize);
- /* The blocksize must be at least 1k */
- if ((blocksize >> 10) == 0)
+ /* The blocksize must be at least 512B */
+ if ((blocksize >> 9) == 0)
return -BLKID_ERR_PARAM;
/* If the superblock is inside the journal, we have the wrong one */
- if (mag->kboff / (blocksize >> 10) > le32_to_cpu(rs->rs_journal_block))
+ if (mag->kboff / (blocksize >> 9) > le32_to_cpu(rs->rs_journal_block) / 2)
return -BLKID_ERR_BIG;
/* LABEL/UUID are only valid for later versions of Reiserfs v3.6. */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next reply other threads:[~2012-05-03 12:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 12:16 Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2012-05-04 9:51 ` [PATCH] Accept small blocks for NTFS and Reiserfs in blkid 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=4FA27707.4090608@gmail.com \
--to=phcoder@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.