summaryrefslogtreecommitdiff
path: root/shlibs/blkid/src/superblocks
AgeCommit message (Collapse)AuthorFilesLines
2011-01-20libblkid: add blkdev.h to blkidP.hKarel Zak1-3/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-30libblkid: fix endian conversion bug in NILFSKarel Zak1-1/+1
Reported-by: Andrew Nayenko <resver@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-03libblkid: NTFS volume label not foundKarel Zak1-1/+1
Reported-by: Hugh Eaves <hugh@hugheaves.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30libblkid: add LINHIB0001 signature to swap proberKarel Zak1-0/+12
The new swsuspend signature has been added by commit 3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1. Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org> Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-26libblkid: 256MiB is min size of btrfsKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-08libblkid: add magic to vfatJeroen Oortwijn1-0/+1
Add the "FAT " magic to vfat. There are devices that use this magic in their FAT filesystem. Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/491476 Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
2010-11-01libblkid: add signature to FAT32 fsinfo blockJeroen Oortwijn1-0/+1
Add 0x41645252 to the list of valid signatures of the FAT32 fsinfo block. It isn't a valid signature, but there are devices that use this signature in their FAT32 filesystem. Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/589369 Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
2010-10-15libblkid: fix MBR detection on iPod and cleanup vfat codeKarel Zak1-93/+173
- move all FAT code to superblocks/vfat.c only - add a generic function to verify FAT superblock and use it in FAT prober as well as in MBR parser - add a more robust FAT cluster_count check (it seems that iPod contains an "almost valid" FAT superblock before MBR) Reported-by: Davidlohr Bueso <dave.bueso@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-15libblkid: consolidate magic strings detection codeKarel Zak1-25/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-07libblkid: add searching in attributes dir to BeFSJeroen Oortwijn1-60/+323
Add searching for the be:volume_id attribute in the attributes directory of the root directory. UUID is now always set when the root directory contains the be:volume_id attribute. Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
2010-09-07libblkid: don't ignore zero for SBMAGIC_OFFSETKarel Zak1-4/+3
The side effect of this bug is that wipefs(8) does not report LUKS... Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-04libblkid: remove dead code sectionValerie Aurora1-47/+0
commit 2d12ea54c70c9e6a2b77ca6f7b6a786309a22fa7 Author: Valerie Aurora <vaurora@redhat.com> Date: Thu Jul 29 12:47:35 2010 -0700 libblkid: remove dead code section (duplication of ext* constants) Signed-off-by: Valerie Aurora <vaurora@redhat.com>
2010-07-26libblkid: set tolerant flag for HFSAlexandre Peixoto Ferreira1-0/+1
An CDROM can contain both HFS and ISO9660 views on the same filesystem. This confuses mount/KDE/Gnome. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-07-26libblkid: fix typo filesystem name nilfs to nilfs2Jiro SEKIBA1-1/+1
The correct filesystem name is nilfs2, not nilfs. Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
2010-07-13libblkid: add nilfs2 filesystem superblock probeJiro SEKIBA4-0/+123
This patch implements nilfs2_idinfo to proble nilfs2 partition. The patch probes uuid, label, version and verify crc check sum of superblock. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-04libblkid: optimize UDF label readingKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01libblkid: add exFAT file system detection supportAndrew Nayenko4-2/+151
Add exFAT file system <http://en.wikipedia.org/wiki/ExFAT> detection support. Signed-off-by: Andrew Nayenko <resver@gmail.com>
2010-05-21libblkid: improve MD 0.90.0 detection (use sb->size)Karel Zak1-3/+22
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-18libblkid: improbe DDF detectionKarel Zak1-6/+65
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-18libblkid: probe for (non-linux) RAIDs on whole devices onlyKarel Zak9-0/+28
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-18libblkid: cleanup superblocks_safeprobe()Karel Zak1-86/+18
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-18libblkid: improve MD 0.90 detectionKarel Zak2-27/+20
We don't have to check for collision between partition table and RAID on all RAIDs. This problem is specific to MD, where underlying device could be a partition. The RAIDs like via, intel, ... always use whole-disks only. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-18libblkid: improve MD 1.0 detection, add UUID_SUBKarel Zak1-6/+64
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=592958 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-06libblkid: set correct offsets for TuxOnIce signatureChow Loong Jin1-6/+14
TuxOnIce stores its signature at the beginning of the swap, rather than at the end of the first page like swsusp does. [kzak@redhat.com: - use macro for TOI magic string, - check for TOI in swap probing function to avoid collision between swap and TOI] Signed-off-by: Chow Loong Jin <hyperair@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-28libblkid: fix LUKS versionKarel Zak1-1/+1
Reported-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-23libblkid: reset superblocks result after errorKarel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-22libblkid: fix collision between RAID and PT probingKarel Zak1-3/+33
The RAID signature is usually at end of the block device. We have to differentiate between: - RAID signature at the end of disk, and - RAID signature at the end of the last partition The position of the signature is same in both cases... It means we have to the parse partition table and check if the area where is RAID signature is covered by any partition. If yes, then the RAID signature belongs to the partition and has to be ignored during whole-disk probing. The second problem are RAID1 underlaying disks (=raid members). The RAID device could be partitioned, in such a case the partition table is visible from underlaying devices. These partition tables has to be ignored. The libblkid ignores partition tables on raid members now. Note that all these changes are implemented for blkid_do_safeprobe() only. The others functions allow to access all detected superblocks or partition tables. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=543749 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-21liblkid: export magic strings from raidsKarel Zak15-15/+82
The library provides detected magic strings by SBMAGIC= and offsets of the magic strings by SBMAGIC_OFFSET= variables. This patch allows to support this feature for RAIDs and filesystems where the magic string is not on fixed position. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-21libblkid: add partial support for superblock binary APIKarel Zak2-9/+94
The API is used only internally. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-31libblkid: avoid probing CDs for RAIDM.S.Colclough1-0/+5
RAID probing of CD/DVD can yield errors because of well-known problem in reading the end of the disk with some disk/drive combinations. Borrow CD detection method from udev and skip the RAID tests for these devices. [kzak@redhat.com: - check for linux/cdrom.h in ./configure - add #ifdef around the ioctl call - call the ioctl for block devices only] Signed-off-by: Mark Colclough <m.s.colclough@bham.ac.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-14libblkid: fix infinite loop when probe chain bails out earlyColin Watson1-1/+3
The superblocks probe bails out early with no results in some cases. If this happens, blkid_do_probe needs to go to the next chain, rather than entering an infinite loop calling superblocks_probe over and over again. [kzak@redhat.com: - print debug message always when leaving superblocks_probe()] Addresses: https://bugs.launchpad.net/bugs/528073 Signed-off-by: Colin Watson <cjwatson@canonical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11libblkid: remove "0x" prefix from DRBD UUIDKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11libblkid: improve ZFS detection and add LABEL and UUID extractionAndreas Dilger1-35/+175
Improve ZFS uberblock detection to loop over multiple uberblocks, and detect at least 4 magic values, to avoid random collisions. It doesn't yet probe the VDEV LABEL at the end of the device, though it wouldn't be too hard to add it at this point if needed. Add extraction of the pool name (as LABEL), the VDEV (block device) guid as UUID_SUB, and pool_guid (volume) as UUID from the nvlist in the VDEV LABEL. Do simple sanity checking on the nvlist data values to avoid overflowing the buffer if they are corrupt in any way. [kzak@redhat.com: - use %PRIu64 instead %llu] Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-11libblkid: prevent overflow in BeFSJeroen Oortwijn1-7/+7
Prevent overflow by casting values to blkid_loff_t before applying block shift. Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
2010-03-08libblkid: more robust minix probingKarel Zak1-0/+10
Unfortunately, it's still possible to interpret some parts of ext3 filesystem as minix superblock ;-( So, the most robust is to check for the extN magic string in minix probing function. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=570606 Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-17libblkid: fix ZSF detectionAndreas Dilger1-8/+18
Fix the ZFS device detection by looking at multiple uberblocks to see if any are present, rather than looking for the ZFS boot block which is not always present. There may be up to 128 uberblocks, but the first 4 are not written to disk on a newly-formatted filesystem so check several of them at different offsets within the uberblock array. [kzak@redhat.com: - port e2fsprogs patch to util-linux-ng] Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-04libblkid: don't return error on empty filesKarel Zak1-1/+1
Currently, the library does not allow to initialize blkid_probe if the file (or block device) is empty. The empty file is reported as an error. That's wrong. The empty file should be interpreted as a file without any FS or PT. It means that blkid_do_{probe,safeprobe,fullprobe}() have to return 1 ("nothing"). Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-02libblkid: minor fixes in befs.cKarel Zak1-8/+16
The library does not reset the probing result (e.g. LABEL, VERSION) when the probing function failed (return value != 0). We have to be absolutely sure that the FS has been properly detected before we set LABEL or VERSION or so. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-02libblkid: Add probing function for BeFSJeroen Oortwijn1-1/+182
Add probing function for the Be File System to libblkid. It sets LABEL, VERSION and UUID. But UUID is only set if the be:volume_id attribute is found in the small_data area of the i-node of the root directory. [kzak@redhat.com: - add .minsz = 1024*1440 to avoid BeFS probing on very small devices] Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-02libblkid: Add initial support for BeFS detectionJeroen Oortwijn4-2/+23
Add initial support for detection of the Be File System <http://en.wikipedia.org/wiki/Be_File_System> to libblkid. Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
2010-01-27libblkid: more robust minix probingKarel Zak1-3/+67
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-22libblkid: fix segfault in drdbMatthias König1-1/+2
Check if blkid_probe_get_buffer() returns NULL to avoid dereferencing a zero pointer resulting in a segfault. Signed-off-by: Matthias König <mk@phasorlab.de>
2010-01-21libblkid: add sanity checks for FAT to DOS PT parserKarel Zak1-63/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-20libblkid: rewrite blkid_probe_get_buffer()Karel Zak1-3/+3
The library does not use any buffer with fixed size any more. The new version calls read() for necessary data only. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-19libblkid: add minimal sizes for OCFS and GFSKarel Zak2-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-19libblkid: don't call read() per FAT dir-entry on large disksKarel Zak1-9/+36
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-19libblkid: set minimal size for jfs, reiser, swap and zfsKarel Zak5-2/+13
.. and don't probe for swap or ext. journal on tiny disks. Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-19libblkid: call read() per FAT root dir entryKarel Zak1-23/+27
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-18libblkid: read() optimization for small devicesKarel Zak1-4/+5
- don't read the begin (69kB) of the device by one large read() - fill in the SB buffer dynamically - use extra buffer for FATs root dir entries (FAT FS label) on small devices to avoid large reads Detect FAT12 on 1.4MB device (number of bytes): Old version: $ strace -e read blkid -p floppy.img 2>&1 | \ awk -F ' = ' 'BEGIN {x=0} /read/ && !/.*ELF/ {x += $2} END { print x }' 73292 New version: $ strace -e read blkid -p floppy.img 2>&1 | \ awk -F ' = ' 'BEGIN {x=0} /read/ && !/.*ELF/ {x += $2} END { print x }' 8192 Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-18libblkid: restrict RAID/FS proving for small devices (1.4MiB)Karel Zak1-4/+23
- don't ignore @size in blkid_probe_set_device() - ignore extremely small devices (<= 1024 bytes, e.g. extended partitions) - don't use safe probing for small devices - don't probe for RAIDs on small devices Signed-off-by: Karel Zak <kzak@redhat.com>