summaryrefslogtreecommitdiff
path: root/lib/blkid
AgeCommit message (Collapse)AuthorFilesLines
2011-11-29Update Release Notes, Changelogs, version.h, etc. for 1.42 releaseTheodore Ts'o1-12/+25
Also fixed depfix.sed Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18Shorten compile commands run by the build systemTheodore Ts'o13-0/+13
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and this was starting to cause some tools heartburn. It also made "make V=1" almost useless, since trying to following the individual commands run by make was lost in the noise of all of the defines. So fix this by putting the configure-generated defines in lib/config.h and the directory pathnames to lib/dirpaths.h. In addition, clean up some vestigal defines in configure.in and in the Makefiles to further shorten the cc command lines. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-11misc: clean up compiler warningsAndreas Dilger1-3/+4
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-25e2fsprogs: reserving code points for new ext4 quota featureAditya Kali1-0/+1
This patch adds support for detecting the new 'quota' feature in ext4. The patch reserves code points for usr and group quota inodes and also for the feature flag EXT4_FEATURE_RO_COMPAT_QUOTA. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-10-04Don't use in-tree header files if using system uuid or blkid librariesTheodore Ts'o3-36/+21
This commit forces the use of the system-provided blkid or uuid header files if we are using the system-provided blkid or uuid libraries. This avoids using the in-tree header files with the system libraries. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03blkid: Avoid a potentially error message when running "make clean"Theodore Ts'o1-1/+2
This error isn't terribly important, but apparently it causes some users/developers distress. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-08-27blkid: support .ko.gz in modules.dep parserKarel Zak1-9/+8
The Linux kernel modules could be compressed, it means modules.dep parser in libblid has to support .ko.gz extension too. (Note, I've talked about this problem with Jon Masters and his suggestion is to exec(/sbin/modinfo) rather than directly parse modules.dep. BTW, the modules.dep file is deprecated.) Address-Red-Hat-Bug: #518572 Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-07-02Add support for configure --enable-verbose-makecmdsTheodore Ts'o1-54/+54
Some people don't want to see the concise "kernel-style" make output. This configure option allows build engines that want to see the full set of commands executed by the makefile to get what they want. Most people will find this more distracting than useful, unless they need to debug the Makefiles. (It is not necessary to rerun configure to enable this verbose make output temprarily; if a developer wants to do a quick debug of a directory's makefile, he or she can simply edit the definition of the $(E) and $(Q) variables in the Makefile; instructions can be found in the MCONFIG file which is included in at the beginning of every Makefile.) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-17blkid: Don't use a hard-coded path for /bin/rm in test_probe.inTheodore Ts'o1-1/+1
Addresses-Sourceforge-Bug: #2780205 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-02blkid: use /sys/block/dm-<N>/dm/nameKarel Zak1-1/+29
The Linux kernel (since 2.6.29, patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128) exports the real DM device names in /sys/block/<ptname>/dm/name. The sysfs based solution is nicer and faster than scan for devno in /dev/mapper/. CC: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-05-02blkid: use /dev/mapper/<name> rather than /dev/dm-<N>Karel Zak1-2/+11
The libblkid (since v1.41.1) returns private device-mapper names (e.g. /dev/dm-0). It's because the probe_one() function scans /dev before /dev/mapper. brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/dm-0 brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/mapper/TestVolGroup-TestLogVolume Old version: # blkid -t LABEL="TEST-LABEL" -o device /dev/dm-0 Fixed version: # blkid -t LABEL="TEST-LABEL" -o device /dev/mapper/TestVolGroup-TestLogVolume Addresses-Red-Hat-Bug: #497259 Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-04-22blkid: remove whole-disk entries from cache when partitions are foundEric Sandeen1-0/+24
We can get into a situation in blkid where whole disks remain in the cache, even though partitions are found. For labels such as sun disklabels which may have the first partition beginning at sector 0, this is even somewhat likely. 1) create a sun disklabel w/partitions 2) mkfs the first partition (at sector 0) 3) remove the partition table 4) run blkid - this finds the fs on the whole disk, places in cache 5) recreate the partition table 6) run blkid - this finds the partition, places in cache And now we have both /dev/sda and /dev/sda1 in cache. There are heuristics in probe_all to avoid putting the whole disk in cache if it has partitions, but there is nothing to remove the whole-disk entry in the above case. I think the below patch suffices, although I haven't quite convinced myself that setting the lens[which]=0; is the right logic for that bit of state... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-08remove useless if-before-free testsJim Meyering7-30/+15
In case you're wondering about whether this change is safe from a portability standpoint, fear not. This has been beaten to death in other forums. Here are a few threads: http://thread.gmane.org/gmane.comp.version-control.git/74187 http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712 http://thread.gmane.org/gmane.emacs.devel/98144 http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092 There has been debate about whether it's a good idea from a performance standpoint, too, but imho you'll have a hard time finding an instance where this sort of change induces a measurable performance penalty. If you do, please let me know. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not presentTheodore Ts'o1-0/+83
Starting in 2.6.29, ext4 can be used to support filesystems without a journal. So if ext2 is not present, and the kernel version is greater than 2.6.29, and ext4 is present, return a filesystme type of ext4. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-03-06blkid: recognize ext4(dev) without journalEric Sandeen1-10/+0
ext4/ext4dev no longer require a journal. w/o this blkid doesn't recognize after: # mkfs.ext4 /dev/blah # tune2fs -O ^has_journal # blkid /dev/blah We still must have one ext3-incompat-feature to flag as ext4(dev) so we shouldn't ever mis-recognize it. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-06e2fsprogs: fix potential null ptr defef in check_for_modules()Eric Sandeen1-0/+2
The coverity scanner found this one. If a line in modules.dep has a ":" but no "/" then: if ((cp = strchr(buf, ':')) != NULL) *cp = 0; else continue; if ((cp = strrchr(buf, '/')) != NULL) cp++; /* XXX else cp is still null */ i = strlen(cp); ... we will deref a null pointer (cp). This can be demonstrated by putting a line like: foo.ko: into modules.dep. The below change just says that if no "/" is found, treat the whole string as the module name. Addresses-Red-Hat-Bugzilla: #486997 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20blkid: Add support for detecting user-level suspend as a swsuspend signatureTheodore Ts'o1-0/+5
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20blkid: recognize btrfsEric Sandeen2-0/+121
Add btrfs detection to libblkid, now that the disk format should be recognizable in the future. # misc/blkid /tmp/fsfile /tmp/fsfile: LABEL="mylabel" UUID="102b07f0-0e79-4b42-8a4e-1dde418bbe6d" TYPE="btrfs" Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-18blkid: recognize ext3 with test_fs set as ext3Eric Sandeen1-4/+0
It seems that if we have the test_filesystem flag set on an ext3 filesystem(!) on a system which provides ext4, blkid gets confused. According to the current logic: * It's not an ext4dev filesystem, because the system provides ext4. * It's not an ext4 filesystem, because it has no ext4 features. * It's not an ext3 filesystem, because the test flag is set. In the end, it's nothing. blkid should return *something* that is mountable... I'm inclined to think that ext3 should be the right answer, if no ext4-specific features are set. This would mean just dropping the EXT2_FLAGS_TEST_FILESYS test in probe_ext3(), because ext4 & ext4dev probes have come first already. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-10-18libblkid: Refuse to create a device structure for a non-existent deviceTheodore Ts'o1-0/+2
Fix blkid_get_dev() so it will never return a device structure if the device file doesn't exist. Addresses-Debian-Bug: #502541 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12libblkid: Fix file descriptor leak when checking for a moduleTheodore Ts'o1-1/+3
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12e2fsprogs: fix blkid detection of ext4dev as ext4Eric Sandeen1-2/+6
If only ext4 is available (as a module or in /proc/filesystems) blkid wasn't properly testing for it, because the time checks were backwards and always failed. This caused old ext4dev filesystems to fail to mount as ext4. With this patch it works fine. Also, don't try to check for modules on a non-Linux system. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-09-02Fix pkg-config files: use Requires.private and fix the include directoryTheodore Ts'o1-2/+2
Addresses-Sourceforge-Bug: #2089537 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27Remove trailing whitespace for the entire source treeTheodore Ts'o13-101/+101
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27libblkid: Give a priority bonus to "leaf" devicemapper devicesTheodore Ts'o1-3/+37
Give a boost to dm devices which are not used to build other dm devices, since "leaf" devices are generally more likely to be interesting as devices to mount. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27libblkid: Unexport the private symbol blkid_devdirsTheodore Ts'o2-3/+2
blkid_devdirs was defined in blkidP.h and was never intended to be used outside of the library. Since it no longer needs to be shared across object files, rename it and turn it into a static variable. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-26Remove use of devmapper library by the blkid libraryTheodore Ts'o3-197/+2
The devmapper library is no longer needed given commit f4e89bcd. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-26libblkid: Optimize devicemapper supportTheodore Ts'o3-14/+28
This commit works by removing all calls from libdevmapper altogether, and using the standard support for "normal" non-dm devices. It depends on dm devices being placed in /dev/mapper (but the previous code had this dependency anyway), and /proc/partitions containing dm devices. We don't actually rip out the libdevmapper code in this commit, but just disable it via #undef HAVE_DEVMAPPER, just so it's easier to review and understand the fundamental code changes. A subsequent commit will remove the libdevmapper code, as well as unexport the blkid_devdirs string array. Thanks to Karel Zak for inspiring me to look at the dm code in blkid, so I could realize how much it deserved to ripped out by its roots. :-) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24libblkid: Fix namespace leakage of unicode_16be_to_utf8Theodore Ts'o1-2/+2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24Fix miscellaneous compile warningsAndreas Dilger1-3/+3
Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24libblkid: Strengthen the JFS probe routineTheodore Ts'o2-4/+17
Check to make sure a JFS filesystem is really correct by checking the relationship between the following fields in the JFS superblock: s_bsize, s_l2bsize, s_pbsize, s_l2pbsize, and s_l2bfactor. Thanks to Lesh Bogdanow for this suggestion. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24libblkid: Fix false detection of DFSee created filesystems.Theodore Ts'o1-7/+20
OS/2 and DFSee creates a pseudo FAT-12/16 header in the first 512 bytes of a filesystem which looks enough like a FAT-12/16 to fool blkid. Part of this is because we don't require ms_magic or vs_magic to be the strings "FAT12 ", "FAT16 ", or "FAT32 ", since some FAT filesystem formatters don't set ms_magic or vs_magic. To address this, we explicitly test for "JFS " and "HPFS " in ms_magic, and if they are found, we assume the filesystem is definitely not a FAT filesystem. Addresses-Launchpad-Bug: #255255 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22libblkid: Enhance support for MacOS's hfs, hfsplus, and hfsx filesystemsTheodore Ts'o2-6/+240
Add detection for hfsx filesystems. Add label and uuid detetion for hfs, hfsplus, and hfsx. Addresses-Sourceforge-Feature-Requests: #2060292 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22libblkid: Fix potential crash if blkid cache is out of date when probingTheodore Ts'o1-2/+2
Fix bug added in 57926c8c5566f0ef5b77db326d58aa0643cf6270 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-14libblkid: On the man page, replace empty references with an existing one.Benno Schulenberg1-15/+9
And update the FSF's address. Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-09blkid: Fix probing logic so we find renamed devicesTheodore Ts'o1-2/+4
This fixes a bug where if there is an entry in the /etc/blkid.tab file for a particular device (major, minor) number but the filename does not exist, blkid wouldn't try to find the correct filename. Addresses-Debian-Bug: #493216
2008-07-13libblkid: Make sure we never reference a null dev->bid_typeTheodore Ts'o3-3/+6
There were a few places where we don't check to make sure dev->bid_type is non-NULL before dereferencing the pointer, mostly in debug code. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-10blkid: Make regression test tolerate older versions of mkswapAndreas Dilger1-11/+24
The blkid/tests contains new tests for swap, but the type-1 swapfile test depends on mkswap supporting the "-U" option to specify the UUID. This is not available even on relatively recent versions of mkswap (2.13.1 16-Jan-2008) so the test needs to be changed to handle this. If the "-U" option is not supported, don't verify the UUID in the blkid output during testing. Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-07Add ZFS test image to blkid test suiteRicardo M. Correia2-0/+1
Signed-off-by: Ricardo M. Correia <Ricardo.M.Correia@Sun.COM> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06Clean up some trivial build warningsEric Sandeen1-3/+4
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-28blkid: Eliminate stale entries that duplicate a verified deviceTheodore Ts'o1-2/+36
Addresses-Debian-Bug: #487758, #487783 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-28blkid: Make sure a device returned by blkid_find_dev_with_tag existsTheodore Ts'o1-2/+4
There could be stale entries in blkid file, so if the device does not exist, skip it. Addresses-Debian-Bug: #487758, #487783 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-28blkid: use list_for_each_safe in garbage collectionEric Sandeen1-2/+2
We need to use list_for_each_safe in case a device gets removed from the list during garbage collection. Also make the manpage slightly more informative about what the -g garbage collection option does. Addresses-Debian-Bug: #487758, #487783 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-21blkid: Fix cc portability problem in probe_lvm2()Theodore Ts'o1-1/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-19blkid: fix swap tests (again)Eric Sandeen1-1/+4
Some architectures (ppc ...) need a bigger swapfile than is shipped, in the test image so the current re-make of swap was failing. We could either ship a bigger image or just dd a bigger file... There is one more minor problem with the tests; older mkswap does not support the -U uuid specification. I'm not sure offhand what to do about that problem, or if it really needs fixing. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17Merge branch 'maint'Theodore Ts'o1-3/+2
Conflicts: README resize/online.c version.h
2008-06-17libblkid: Fix marginal C code in probe_lvm2()Theodore Ts'o1-3/+2
Modern gcc accepted what was there previously, but it's clearly not correct C code, and this may have been the explanation for why a user trying to compile a recent version of e2fsprogs failed to do so on Red Hat 7.3. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-02Merge branch 'maint' into nextTheodore Ts'o1-12/+21
2008-06-02Add ZFS detection to libblkidRicardo M. Correia1-12/+21
This patch adds ZFS filesystem detection to libblkid. It probes for VDEV_BOOT_MAGIC in the first 2 ZFS labels in big-endian and little-endian formats. Unfortunately the probe table doesn't support probing from the end of the device, otherwise we could also probe in the 3rd and 4th labels (in case the first 2 labels were accidentally overwritten).. Eventually we would set the UUID from the ZFS pool GUID and the LABEL tag from the pool name, but that requires parsing an XDR encoding of the pool configuration which is not trivial. Signed-off-by: Ricardo M. Correia <Ricardo.M.Correia@Sun.COM> Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-25Remove bashism in test script for libblkidTheodore Ts'o1-2/+2
Thanks to Christian Kujau for pointing this out. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>