.. and don't probe for swap or ext. journal on tiny disks.
Signed-off-by: Karel Zak <kzak@redhat.com>
const char *name; /* fs, raid or partition table name */
int usage; /* BLKID_USAGE_* flag */
int flags; /* BLKID_IDINFO_* flags */
+ int minsz; /* minimal device size */
/* probe function */
int (*probefunc)(blkid_probe pr, const struct blkid_idmag *mag);
.name = "jfs",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_jfs,
+ .minsz = 16 * 1024 * 1024,
.magics =
{
{ .magic = "JFS1", .len = 4, .kboff = 32 },
.name = "reiserfs",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_reiser,
+ .minsz = 4096 * 512, /* not sure, this is minimal size of journal */
.magics =
{
{ .magic = "ReIsErFs", .len = 8, .kboff = 8, .sboff = 0x34 },
.name = "reiser4",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_reiser4,
+ .minsz = 4096 * 512, /* not sure, this is minimal size of journal */
.magics =
{
{ .magic = "ReIsEr4", .len = 7, .kboff = 64 },
continue;
id = idinfos[i];
+
+ if (id->minsz && id->minsz > pr->size)
+ continue; /* the device is too small */
+
mag = id->magics ? &id->magics[0] : NULL;
- /* don't probe for RAIDs on floppies */
- if ((id->usage & BLKID_USAGE_RAID) && blkid_probe_is_tiny(pr))
+ /* don't probe for RAIDs, swap or journal on floppies */
+ if ((id->usage & (BLKID_USAGE_RAID | BLKID_USAGE_OTHER)) &&
+ blkid_probe_is_tiny(pr))
continue;
DBG(DEBUG_LOWPROBE, printf("[%d] %s:\n", i, id->name));
.name = "swap",
.usage = BLKID_USAGE_OTHER,
.probefunc = probe_swap,
+ .minsz = 10 * 4096, /* 10 pages */
.magics =
{
{ "SWAP-SPACE", 10, 0, 0xff6 },
.name = "swsuspend",
.usage = BLKID_USAGE_OTHER,
.probefunc = probe_swsuspend,
+ .minsz = 10 * 4096, /* 10 pages */
.magics =
{
{ "S1SUSPEND", 9, 0, 0xff6 },
.name = "zfs",
.usage = BLKID_USAGE_FILESYSTEM,
.probefunc = probe_zfs,
+ .minsz = 64 * 1024 * 1024,
.magics =
{
{ .magic = "\0\0\x02\xf5\xb0\x07\xb1\x0c", .len = 8, .kboff = 8 },