Commit Graph

222 Commits (499d5ec5582209279bb0cf86672770d77b047871)

Author SHA1 Message Date
Theodore Ts'o 499d5ec558 Update Release Notes, Changelogs, version.h, etc. for 1.42 release
Also fixed depfix.sed

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-29 16:48:14 -05:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
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-09-18 17:34:37 -04:00
Andreas Dilger cf5301d7f2 misc: clean up compiler warnings
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-06-11 10:58:25 -04:00
Aditya Kali 0edcc27021 e2fsprogs: reserving code points for new ext4 quota feature
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>
2011-02-25 18:31:52 -05:00
Theodore Ts'o e1f0850795 Don't use in-tree header files if using system uuid or blkid libraries
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-04 14:45:08 -04:00
Theodore Ts'o 7822f784f1 blkid: Avoid a potentially error message when running "make clean"
This error isn't terribly important, but apparently it causes some
users/developers distress.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-10-03 22:33:47 -04:00
Karel Zak 249c962ad8 blkid: support .ko.gz in modules.dep parser
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-08-27 20:58:54 -04:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
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-07-02 00:11:17 -04:00
Theodore Ts'o 5dd3311eeb blkid: Don't use a hard-coded path for /bin/rm in test_probe.in
Addresses-Sourceforge-Bug: #2780205

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-05-17 22:19:21 -04:00
Karel Zak 46f3eeca59 blkid: use /sys/block/dm-<N>/dm/name
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-02 22:39:20 -04:00
Karel Zak 4271e23942 blkid: use /dev/mapper/<name> rather than /dev/dm-<N>
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-05-02 22:33:13 -04:00
Eric Sandeen 4e60e06847 blkid: remove whole-disk entries from cache when partitions are found
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-04-22 22:52:40 -04:00
Jim Meyering 45e338f533 remove useless if-before-free tests
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-08 20:37:12 -04:00
Theodore Ts'o 1361821e7e blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not present
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-08 18:56:41 -04:00
Eric Sandeen a90f5391dd blkid: recognize ext4(dev) without journal
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-06 02:44:07 -05:00
Eric Sandeen f2fe5da31d e2fsprogs: fix potential null ptr defef in check_for_modules()
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-03-06 02:37:33 -05:00
Theodore Ts'o 31e2a75484 blkid: Add support for detecting user-level suspend as a swsuspend signature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-01-20 12:08:07 -05:00
Eric Sandeen 801b005333 blkid: recognize btrfs
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>
2009-01-20 00:57:59 -05:00
Eric Sandeen 9e7da0bdc1 blkid: recognize ext3 with test_fs set as ext3
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-18 17:19:56 -04:00
Theodore Ts'o fe144e11e9 libblkid: Refuse to create a device structure for a non-existent device
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-18 16:47:46 -04:00
Theodore Ts'o 6964a17720 libblkid: Fix file descriptor leak when checking for a module
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-10-12 23:12:22 -04:00
Eric Sandeen 18f7343010 e2fsprogs: fix blkid detection of ext4dev as ext4
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-10-12 23:11:44 -04:00
Theodore Ts'o 97be89b60b Fix pkg-config files: use Requires.private and fix the include directory
Addresses-Sourceforge-Bug: #2089537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 21:20:44 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o e6baebd2a9 libblkid: Give a priority bonus to "leaf" devicemapper devices
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-27 02:24:51 -04:00
Theodore Ts'o 0bb740621f libblkid: Unexport the private symbol blkid_devdirs
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-27 00:00:44 -04:00
Theodore Ts'o 7515a74478 Remove use of devmapper library by the blkid library
The devmapper library is no longer needed given commit f4e89bcd.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-26 23:56:00 -04:00
Theodore Ts'o f4e89bcdf2 libblkid: Optimize devicemapper support
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-26 23:53:22 -04:00
Theodore Ts'o d56ccbd8f9 libblkid: Fix namespace leakage of unicode_16be_to_utf8
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24 23:34:13 -04:00
Andreas Dilger 864b8d4eab Fix miscellaneous compile warnings
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-24 20:37:39 -04:00
Theodore Ts'o b41fb00225 libblkid: Strengthen the JFS probe routine
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-24 17:29:33 -04:00
Theodore Ts'o 78d89cda68 libblkid: Fix false detection of DFSee created filesystems.
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-24 17:24:18 -04:00
Theodore Ts'o 9c460caae3 libblkid: Enhance support for MacOS's hfs, hfsplus, and hfsx filesystems
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-22 16:45:44 -04:00
Theodore Ts'o 5b7adf0690 libblkid: Fix potential crash if blkid cache is out of date when probing
Fix bug added in 57926c8c55

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-22 12:43:14 -04:00
Benno Schulenberg dcf051eccc libblkid: On the man page, replace empty references with an existing one.
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-14 13:31:37 -04:00
Theodore Ts'o 57926c8c55 blkid: Fix probing logic so we find renamed devices
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-08-09 22:37:58 -04:00
Theodore Ts'o bb47c2a4af libblkid: Make sure we never reference a null dev->bid_type
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-13 19:10:10 -04:00
Andreas Dilger 3fc1db6218 blkid: Make regression test tolerate older versions of mkswap
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-10 08:52:50 -04:00
Ricardo M. Correia c03d992429 Add ZFS test image to blkid test suite
Signed-off-by: Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-07 15:13:09 -04:00
Eric Sandeen 79e62409b3 Clean up some trivial build warnings
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06 18:36:56 -04:00
Theodore Ts'o bf58e3d1c6 blkid: Eliminate stale entries that duplicate a verified device
Addresses-Debian-Bug: #487758, #487783

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-28 22:17:54 -04:00
Theodore Ts'o b697f9d01c blkid: Make sure a device returned by blkid_find_dev_with_tag exists
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-28 22:17:43 -04:00
Eric Sandeen 772b89d342 blkid: use list_for_each_safe in garbage collection
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-28 22:17:20 -04:00
Theodore Ts'o 8d45e2104c blkid: Fix cc portability problem in probe_lvm2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-21 14:04:36 -04:00
Eric Sandeen 7f6a74b6d6 blkid: fix swap tests (again)
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-19 14:30:23 -04:00
Theodore Ts'o 71ff129e9f Merge branch 'maint'
Conflicts:

	README
	resize/online.c
	version.h
2008-06-17 23:54:51 -04:00
Theodore Ts'o cc19b95860 libblkid: Fix marginal C code in probe_lvm2()
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-17 13:03:47 -04:00
Theodore Ts'o 8aa53bfa69 Merge branch 'maint' into next 2008-06-02 21:40:02 -04:00
Ricardo M. Correia c9bad3ce1a Add ZFS detection to libblkid
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-06-02 21:09:08 -04:00
Theodore Ts'o 168b6b53be Remove bashism in test script for libblkid
Thanks to Christian Kujau for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-25 19:45:29 -04:00