Commit Graph

281 Commits (205593f65b2f78c2cc8116a7827c241ebc8387fc)

Author SHA1 Message Date
Theodore Ts'o b9b5e43ea8 Merge branch 'maint' into next
Conflicts:
	RELEASE-NOTES
	debian/changelog
	lib/ext2fs/crc32c.c
	lib/ext2fs/rw_bitmaps.c
	resize/resize2fs.c
	version.h
2013-01-01 18:50:26 -05:00
Andreas Dilger 00eb0eee0a build: quiet some "gcc -Wall" compiler warnings
Quiet a number of simple compiler warnings:
- pointers not initialized by ext2fs_get_mem()
- return without value in non-void function
- dereferencing type-punned pointers
- unused variables

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-12-29 17:39:45 -05:00
Theodore Ts'o ccea20f62d Merge branch 'maint' into next
Conflicts:
	misc/tune2fs.c
2012-11-29 19:54:46 -05:00
Andreas Dilger 3e554cc116 ext2fs, blkid: localize environment-specific variables
Restructure the ext2fs_get_device_size() and blkid_get_dev_size()
code to localize the variables used for different device probing
methods.  This at least reduces the #ifdef mess to only one part
of the code for each method, and avoids "unused variable" compiler
warnings added when variables are declared without being #ifdef'd.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-11-26 09:34:20 -05:00
Theodore Ts'o 2d913dbcdf Merge branch 'maint' into next 2012-08-06 21:09:49 -04:00
Theodore Ts'o d5aa6a82b3 Put ELF_OTHER_LIBS in the right place for the linker
Commit a7c17431b9 attempted to fix a problem where the system
libraries might get used instead of local libraries for things like
-lcom_err.  It tried to accomplish this by moving $(ELF_OTHER_LIBS) to
before $(LDFLAGS).

Unfortunately, this was the wrong fix; $(ELF_OTHER_LIBS) *MUST* be
after the object files, or the linker might not pull in the necessary
library and not include it into the DT_NEEDED section of the shared
library.  The proper fix is to add a -L$(LIB) before $(LDFLAGS), and
then remove the -L option from all of the ELF_OTHER_LIBS definitions
in the library Makefiles.

Addresses-Sourceforge-Bug: #3554345

Cc: Olivier Blin <olivier.blin@softathome.com>
Reported-by:  Mike Frysinger <vapier@gentoo.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-08-06 12:30:49 -04:00
Darrick J. Wong 5d914d721a libext2fs: change ext4 on-disk layout to support metadata checksumming
Define flags and extend ext4 structure definitions to support metadata
checksumming.  Ted Ts'o covered many of these fields in an earlier
patch, but there are more required changes to the disk layout.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-07-30 17:44:15 -04:00
Theodore Ts'o ae06582867 Change pkg-config files so that both <et/com_err.h> and <com_err.h> work
Change the include path in the Cflags field so that #include
<lib/foo.h> and <foo.h> will work.  We had originally used a C flags
which allowed <foo.h> to work, but many applications (especially those
not using pkg-config) had been using the <lob/foo.h> formulation which
didn't require an explicit -I{$includedir} option to the C compiler.

If those applications then converted over to pkg-config, and the
e2fsprogs libraries were installed with a prefix other than /usr, so
that the header files were in some directory such as
/usr/local/include, a program that used #include <lib/foo.h> would
fail to compile.

So change the pkg-config files to include both -I{$includedir} and
-I{$includir}/lib.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-14 12:45:54 -04:00
Andreas Dilger 7270fbe7fa build: fix compile warnings on OSX
Clean up some compile warnings related to fstat64(), which is
verbosely deprecated on OSX.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-02-27 01:28:23 -05:00
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
Theodore Ts'o c0af709e52 Merge branch 'maint'
Conflicts:

	README
	version.h
2008-05-21 16:56:42 -04:00
Theodore Ts'o 492ea6556e blkid: If the device mtime is newer that the cache time, force a revalidation
This fixes problems turned up by a test case written by Erez Zadok's
group which constantly reformats filesystems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-20 17:28:54 -04:00
Eric Sandeen 22269b8b60 - fix swap sanity tests in blkid, and blkid tests
Swap is actually native-endian on disk, and with the latest
swapspace sanity checks I added we need to have native swapspace
examples in the blkid tests, so re-mkswap them during testing.

One one other required change, though; mkswap requires at least
10 pages of swap, so the image needs to be increased to 10x64k
if mkswap is to succeed...

Maybe it'd be better to just dd it out on the fly?

Addresses-redhat-bugzilla: 445786

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-12 16:17:11 -04:00
Theodore Ts'o 4476105bf3 Merge branch 'maint'
Conflicts:

	configure
2008-04-21 21:35:44 -04:00
Theodore Ts'o 8bcaaabb1a blkid: Keep cached filesystem information on EACCES and ENOENT errors
When a nonprivileged user uses the blkid command, we want to keep the
cached filesystem information, and opening a device file could result
in an EACCESS or ENOENT (if an intervening directory is mode 700).  We
were previously testing for EPERM, which was really the wrong error
code to be testing against.

Addresses-Launchpad-Bug: #220275

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-21 19:22:49 -04:00
Eric Sandeen 6360d129d0 blkid: more sanity checks for swap v1
mkswap followed by pvcreate on a block device
will still turn up as "swap" in blkid, because
pvcreate isn't particularly careful about zeroing
old signatures.  (neither is mkswap, for that matter).

Testing for appropriate version and page counts
gives us a bit more confidence that we have a
real swap (v1) partition.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-18 14:31:27 -04:00
Theodore Ts'o a040a99b6c Merge branch 'maint'
Conflicts:

	lib/ext2fs/ext2_err.et.in
2008-03-13 10:53:26 -04:00
Theodore Ts'o dd232049d1 blkid: Fix portability problem caused by using uint instead of unsigned int
This is needed to fix compilation with DJGPP; thanks to Cristophe
Grenier for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-08 20:01:05 -05:00
Theodore Ts'o a49670e64e Merge branch 'maint'
Conflicts:

	lib/blkid/devname.c
	lib/blkid/probe.c
	misc/mke2fs.c
	misc/tune2fs.c
2008-02-27 18:53:34 -05:00
Theodore Ts'o 3a538e4244 Fix gcc -Wall warnings for lib/blkid/probe.c
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-27 02:06:08 -05:00
Theodore Ts'o 1f1ee19485 libblkid: Add error checking to devicemapper code to avoid segfaults
If a device mapper volume disappears while libblkid code is running,
it is possible for the devicemapper code to return errors, and since
libblkid wasn't checking for error returns, it would dereference a
null pointer and crash.  Add error checking to prevent this.

Addresses-RedHat-Bugzilla: #433857

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 22:24:42 -05:00
Eric Sandeen a451d92f38 blkid: detect LVM2 physical volumes
Bits liberally stolen from lvm2 userspace.

Addresses-Red-Hat-Bugzilla: #409321

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-02-19 08:40:15 -05:00
Theodore Ts'o ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -05:00
Theodore Ts'o 5010f295ca Document the BLKID_FILE environment variable in the libblkid man page
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 23:35:03 -05:00
Theodore Ts'o a4045c21a3 blkid: Add support for returning labels for UDF filesystems
Addresses-Sourceforge-Bug: #1886394

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 23:12:56 -05:00
Theodore Ts'o 838f133c72 blkid: Flush cached filesystem information on any error other than EPERM
USB devices can return ENOMEDIUM, and when the filesystem cached
information wasn't flushed, it resulted in the wrong location of a
filesystem to be returned to the caller.  The only justification for
using cached information when the open fails is in the case of a
permission denied error.

Addresses-Debian-Bug: #463787
2008-02-09 22:30:20 -05:00
Theodore Ts'o cfc1931194 blkid: Automatically chose between ext4 and ext4dev as appropriate
Add logic that on Linux systems will check for the presence of the
ext4dev filesystem; if it isn't present, fall back to ext4 for
filesystems that are marked as being "OK for use on test filesystem
code".  If they are OK for use for in-development filesystem code, it
should also be fine to use stable filesystem code if there is no test
filesystem code (ext4dev) available.

The reverse is not true, of course.  We don't ever want to mount a
production filesystem using test filesystem code unless the user gives
us explicit permission via "tune2fs -E test_fs".

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 07:45:21 -05:00
Theodore Ts'o 428f6b32a9 Merge branch 'maint' into next
Conflicts:

	configure
	lib/ext2fs/ext2_fs.h
	misc/e2image.c
2008-01-27 20:09:05 -05:00
Theodore Ts'o c2dbc18a94 Use lseek() instead of llseek() of sizeof(long) == sizeof(long long)
Previously we used a hard-coded test where for the Alpha and the IA64,
we used lseek instead of llseek().  Generalize this to whenver
sizeof(long) is the same as sizeof(long long).

It turns out this fixes a FTBFS problem on the x86_64 for Debian,
since dietlibc doesn't provide llseek() on that architecture.

Addresses-Debian-Bug: #459614

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 00:35:32 -05:00
Theodore Ts'o 69d742284d blkid: Add support for HFS+ detection
From SLES 10 patch: e2fsprogs-blkid_probe_hfsplus.patch

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 00:21:07 -05:00
Theodore Ts'o 4dc30dac2c blkid: Make sure the blocksize in reiserfs is sane
This avoids a floating point exception for corrupt reiserfs images

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 00:14:01 -05:00
Theodore Ts'o 2921332fd8 Teach the blkid library about ext4/ext4dev
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-26 22:25:50 -05:00
Pixel c40ad3674c blkid: have ntfs's UUID compatible with vol_id
Ensure the length of the UUID is always the same

without the patch:

% blkid /tmp/a /tmp/b
/tmp/a: UUID="7130E4771519577F" TYPE="ntfs"
/tmp/b: UUID="7E9B4A7CCE99CA" TYPE="ntfs"

with the patch:

% blkid /tmp/a /tmp/b
/tmp/a: UUID="7130E4771519577F" TYPE="ntfs"
/tmp/b: UUID="007E9B4A7CCE99CA" TYPE="ntfs"

ie same as:

% vol_id --uuid /tmp/a ; vol_id --uuid /tmp/b
7130E4771519577F
007E9B4A7CCE99CA

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-14 10:22:33 -05:00
Theodore Ts'o fef2b38d8e Merge branch 'maint' into next
Conflicts:

	configure
	debian/rules
	e2fsck/swapfs.c
	lib/ext2fs/ext2_fs.h
2008-01-01 12:41:35 -05:00
Theodore Ts'o 9320c6ffcd Fix build error in blkid/tst_types.c when using diet libc
When compiling with diet libc, <sys/types.h> must be included in order
to define the types used in asm/types.h.  Strange choice, but
workable.  This doesn't cause much problems for e2fsprogs except
blkid/tst_types.h, which needed a #include of <sys/types.h>.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:35:18 -05:00
Theodore Ts'o b689b8dd14 Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-17 10:28:01 -05:00
Theodore Ts'o 20c10a7667 blkid: Avoid division by zero error when probing an invalid FAT filesystem
Addresses-Sourceforge-Bug: #1831627

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:21:31 -05:00
Theodore Ts'o e6a4571eec Merge branch 'maint' into next
Conflicts:

	lib/ext2fs/closefs.c
2007-12-09 17:03:01 -05:00
Eric Sandeen 38361bbbb5 e2fsprogs: fix blkid whole-disk scanning heuristics
The heuristics in blkid/devname.c probe_all() for scanning whole disks
with no partitions assume that a device name with no digit on the end
will always be present as a delineator, i.e.:

sda
sda1
sdb
sdc

In this case, when sdc is seen, it's the clue to go back and scan sdb.
However, for something like:

sda
sda1
sdb
loop0

this falls down, and sdb is never scanned.
(thanks to Karel Zak for pointing this out).

Addresses-Red-Hat-Bugzilla: #400321

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-02 05:25:30 -05:00
Dmitry V. Levin 7b7370bd2e blkid.pc, ss.pc: Move private libs from "Libs:" to "Libs.private:"
According to pkg-config(1) manual page, private libraries should be
defined by "Libs.private:" line.  Private libraries are libraries which
are not exposed through our library, but are needed in the case of
static linking.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-11-01 00:32:32 -04:00
Dmitry V. Levin 3b06802bbb blkid/test_probe.in: Fix temporary files handling
Avoid placing files with predictable names in /tmp.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-10-29 10:59:01 -04:00
Theodore Ts'o 042a27f823 Merge branch 'maint' into next 2007-10-15 16:24:56 -04:00
Eric Sandeen f493d4e0ac libblkid: recognize squashfs filesystems on BE systems.
squashfs has no uuid or labels, so all we need is the magic
(for big-endian too!)

Addresses-Red-Hat-Bugzilla: #305151

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2007-10-15 16:23:39 -04:00
Eric Sandeen 5845efd123 libblkid: detect squashfs
libblkid: recognize squashfs filesystems

squashfs has no uuid or labels, so all we need is the magic.

Addresses-Red-Hat-Bugzilla: #305151

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2007-10-14 10:11:52 -04:00
Theodore Ts'o 2628a1d3e1 Merge branch 'maint' 2007-10-06 12:41:26 -04:00
Theodore Ts'o 846be6db81 libblkid: Add more magic numbers that might mean there is a FAT filesystem
The FAT filesystem doesn't have its superblock with a set of magic
strings in a fixed location.  Therefore, we must also check for the
FAT filesystem if it looks like we have an MBR at the beginning of the
partition.  We previously checked if the first byte was a jump
instruction but that missed some USB disks with only one bootable
partition.  Now we check for the MBR signature (0x55AA at offset 510)
as well as any partition where byte 0 is \351 or \353.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-09-23 09:50:11 -04:00
Theodore Ts'o a98b51e9dd Miscellaneous Cleanups
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:10:46 -04:00
Theodore Ts'o d4e0b1c6f5 Fix gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 18:56:01 -04:00
Theodore Ts'o 0225face1b Add debugging printf to blkid's probe routine when original fs type failed
This particular bit of code has caused problems before, so make it
easier to debug problems caused by the probe verification looping
forever here.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 20:17:31 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o ac7dd696d6 Fix bug which could cause libblkid to loop forever
When revalidating a partition where there is obsolete information in
/etc/blkid.tab, we end up freeing a the type tag without clearing
dev->bid_type, causing blkid_verify() to loop forever.

Addresses-Debian-Bug: #432052

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00