Commit Graph

1013 Commits (0eeec8ac61bf1eaa31533b2be825cd75580829c9)

Author SHA1 Message Date
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
Theodore Ts'o bb767b2fc3 ext2fs.h: Add l_i_file_acl_high and l_version_hi to on-disk inode structure
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-15 22:14:52 -04:00
Eric Sandeen 9817a2ba2d fix extent_goto for non-0 leaf levels
The logic for stopping at the right level in extent_goto was wrong,
so if you asked it to go to any level other than 0 (the leaf
level) it would fail.

Also add this argument to the tst_extents goto command to test it.

(I thought this was a failure in my split code but it was this
helper that was causing problems...)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-14 13:28:49 -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
Matthias Koenig cc435cb11a libuuid: don't use unitialized variable
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-05-11 20:41:15 -04:00
Theodore Ts'o b93cb0664e Fix parallel build problem
Problem was introduced by commit a4b69b7f18

Thanks to Eric Sandeen from Red Hat for pointing out this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-11 20:34:12 -04:00
Theodore Ts'o faa08e4c92 Merge branch 'next' into tt/flex-bg 2008-04-27 22:24:36 -04:00
Theodore Ts'o c860850441 ext2fs_add_journal_inode: Optimize writing the journal data blocks
Add a new function ext2fs_zero_blocks(), and use it so that journal
data blocks is written in larger chunks to speed up the creation of
the journal.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 19:42:23 -04:00
Aneesh Kumar K.V 72a168b59c libext2fs: Add undo I/O manager
This I/O manager saves the contents of the location being overwritten
to a tdb database. This helps in undoing the changes done to the
file system.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27 19:40:46 -04:00
Theodore Ts'o 9ba400027f mke2fs: New bitmap and inode table allocation for FLEX_BG
Change the way we allocate bitmaps and inode tables if the FLEX_BG
feature is used at mke2fs time.  It places calculates a new offset for
bitmaps and inode table base on the number of groups that the user
wishes to pack together using the new "-G" option.  Creating a
filesystem with 64 block groups in a flex group can be done by:

mke2fs -j -I 256 -O flex_bg -G 32 /dev/sdX

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22 23:32:16 -04:00
Theodore Ts'o 494a1daad3 Basic flexible block group support
Add superblock definition, and dumpe2fs and debugfs support.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22 23:32:15 -04:00
Theodore Ts'o d11736c6dd ext2fs_open_inode_scan: Handle an non-zero bg_itable_used in block group 0
Previously, the portion of the inode table for block group 0 was
always completely zero'ed out, so the ext2fs_open_inode_scan() didn't
handle a non-zero bg_itable_used value for the first block group.  Fix
this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-22 23:22:17 -04:00
Theodore Ts'o 0f2794c020 mke2fs/libext2fs: Fix lazy inode table initialization
This fixes some bugs which I introduced recently while revamping the
uninit_bg code.  Since mke2fs is no longer calling
ext2fs_set_gdt_csum(), it's important that ext2fs_initialize()
correctly initialize bg_itable_unused for all block group descriptors.
In addition, mke2fs needs to zero out the the reserved inodes based on
the values of bg_itable_unused set by ext2fs_initialize().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-22 23:18:37 -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
Theodore Ts'o 5711ed297b Transfer responsibility of setting the *_UNINIT flags to libext2fs
Mke2fs used to have special case, ugly code in
setup_lazy_bg/setup_uninit_bg flag which set the flags based on all
sorts of special cases.  Change it so that it is done in libext2fs,
and fix mke2fs to use alloc_stats functions which will take care of
clearing the *_UNINIT flags automatically as needed.

This is preparatory work to make the flex_bg allocation patch much
cleaner.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-21 01:39:23 -04:00
Theodore Ts'o 16b851cdae Remove LAZY_BG feature
This simplifies the code, and using the uninit_bg with the inode table
lazily initialized is just as good.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 23:33:34 -04:00
Theodore Ts'o 4a568505ab Add comments documenting ext2fs_[reserve_]super_and_bgd_loc()
Add an explanation of exactly what ext2fs_super_and_bgd_loc() and
ext2fs_reserve_super_and_bgd_loc() do, and more importantly, exactly
what they return.  Note that most callers should *not* rely on the
return value since it's rarely useful, especially once the flex_bg
feature is enabled and inode table and allocation bitmap blocks may
not be in the block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 19:22:49 -04:00
Theodore Ts'o 456e989270 ext2fs_set_gdt_csum: Remove setting of BLOCK_UNINIT
This function tried to set BLOCK_UNINIT based on the return value of
ext2fs_super_and_bgd_loc.  That's not something that works once we
start allowing flex_bg since the block group metadata might not be
located in the blockgroup itself.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 18:31:53 -04:00
Theodore Ts'o 3c5556ed4a ext2fs_set_gdt_csum: Remove bogus setting of ITABLE_ZEROED
It used to be the case that ext2fs_set_gdt_csum set the ITABLE_ZEROED
flag if the INODE_UNINIT is not set.  This assumed that the only
caller of ext2fs_set_gdt_csum was e2fsck (which was not true), and
that e2fsck would take care of zeroing the inode table (whic was also
not true).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 18:31:53 -04:00
Theodore Ts'o 41a5afa87b libe2p: Print the s_min_extra_isize and s_wanted_extra_isize fields
Make dumpe2fs and debugfs print out the s_min_extra_isize and
s_wanted_extra_isize fields from the superblock.

Update tests expect files as appropriate.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 16:10:07 -04:00
Theodore Ts'o 00a92841c2 libext2fs: Initialize s_min_extra_isize and s_wanted_extra_isize
Set the s_min_extra_isize and s_wanted_extra_isize superblock fields
to reasonable defaults in ext2fs_initialize().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20 16:02:13 -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 ba1e1254b0 Change the primary name of the extents feature to be 'extent'
This was the original name used by Lustre's patches; keep the plural
when converting feature names to a feature mask for compatibility's
sake.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 23:33:05 -04:00
Theodore Ts'o 2930dad2b2 Rename the feature uninit_groups to uninit_bg
Allow the old name of uninit_groups when converting feature names for
backwards compatibility for scripts running mke2fs and tune2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 23:31:44 -04:00
Eric Sandeen c21ed7705b Make extent_goto() deterministic when logical block not found
Make sure that extent_goto() leaves us at the last extent
prior to the requested logical block, if the logical block
requested lands in a hole.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-17 17:16:39 -04:00
Eric Sandeen 5e057d5cad Fix ext2fs_extent_insert when at last extent in node
ext2fs_extent_insert() only did a memmove if path->left
was > 0, but if we are at the last extent in the node,
path->left == 0, and this node must be moved before the
current extent is replaced with the newly inserted node.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-17 17:16:29 -04:00
Eric Sandeen 108e62e316 print a bit more info for the tst_extents info command
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 17:05:12 -04:00
Theodore Ts'o daf7a6e5d1 Fix tst_extents build when building w/o dynamic libraries
$(LIBSS) should automatically include @DLOPEN_LIB@ so the right thing
happens for programs that need to use the ss library.

Reorder the library link order for tst_extents since the blkid library
uses libuuid functions.

Thanks to Eric Sandeen for pointing this problem out!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:56:09 -04:00
Theodore Ts'o 1ca1059fd0 Add support for the HUGE_FILE feature
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:38:13 -04:00
Theodore Ts'o a91b3f36dd Merge branch 'maint' 2008-04-17 16:32:28 -04:00
Theodore Ts'o 6a141f218e Fix non-POSIX ">&" in the Makefile for lib/ss's "make check" rule
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-09 15:40:43 -04:00
Eric Sandeen 01c196b4f1 Fix a couple of implicit function declarations
Fedora seems to be gearing up to add
-Werror-implicit-function-declaration
to the standard build flags, so I thought I'd get out ahead
of this one...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06 17:20:12 -04:00
Theodore Ts'o ae389208e9 Merge branch 'maint' into next 2008-04-06 17:10:49 -04:00
Theodore Ts'o 52bb0b050a libext2fs: Fix resize inode creation with non-standard s_first_data_block
Thanks to Max Lindner (lokimuh) for pointing this out.

   I'm playing around a bit with ext2 and multi-user encryption and I
   need space for my key management. So I set s_first_data_block to 4000
   or something like that.

   This way mke2fs segfaults when executing
   ext2fs_create_resize_inode() because

   blk_t goal = 3 + sb->s_reserved_gdt_blocks + fs->desc_blocks +
   fs->inode_blocks_per_group;

   will produce a integer underrun later and segfault then in the
   ext2fs_test_bit assembler inline function.

   when exchanging 3 with 2 + sb->s_first_data_block, mke2fs does not
   segfault.

   I'm not 100% sure if thats the correct way dealing with this issue
   but I think its a proper solution.

Addresses-Sourceforge-Bug: #1935847

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06 17:00:23 -04:00
Theodore Ts'o 3541698f03 libext2fs: Fix big-endian bug in tst_csum.c
It's not necessary to byte-swap the checksum.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 17:03:00 -04:00
Theodore Ts'o a4b69b7f18 Add dependency rule so that static library when necessary for "make check"
Some library makefiles use $(LIB)/$(LIBRARY).a as a dependency for the
static library built by the makefile fragment.  Add it as a target
created when building $(LIBRARY).a so that it is rebuilt when necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 16:45:37 -04:00
Theodore Ts'o 4b57781f50 libext2fs: Make all test programs link only against the static library
This is needed so that all of the test programs compile correctly on
big-endian systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01 16:43:24 -04:00
Andreas Dilger 6f19f44a4c libext2fs: Micro-optimization in inode scan code
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Andreas Dilger f628acea26 ext2fs_set_gdt_csum(): Return an error code on errors instead of void
Change the function signature so that ext2fs_set_gdt_csum() returns an
error code.

If the inode bitmap hasn't been loaded return EXT2_ET_NO_INODE_BITMAP.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Andreas Dilger d78ea441a2 ext2fs_set_gdt_csum(): Force the last block group to have a valid block bitmap
Never set the UNINIT_BLOCKS flag for the last group since the kernel
doesn't handle the case graefully if there is a full set of blocks in
each blockgroup marked UNINIT_BLOCKS.  The kernel should be fixed up,
but in the meantime this avoids hitting the problem, and is more
consistent with lazy_bg not marking the last group UNINIT.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Andreas Dilger 80fc4e698a ext2fs_set_gdt_csum(): Clean up superblock dirty flag handling
Only mark the superblock as dirty if the function actually managed to
change part of the block group descriptor.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31 14:28:37 -04:00
Andreas Dilger 02a73f12df Fix the copyright notice in lib/ext2fs/tst_csum.c to be GPLv2 only
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-30 14:14:31 -04:00
Eric Sandeen d89ad0aefd Fix parallel builds for lib/ext2fs/extent.o
Updated the Makefile dependencies using "make depend".

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-25 09:59:45 -04:00
Eric Sandeen fb6627a3fb libext2fs: Fix byte-swap logic for i_block[] in inodes with extents
ext2fs_swap_inode_full() was incorrectly swapping the i_block array
for extents.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-24 08:25:40 -04:00
Eric Sandeen 85b59c40f4 Fix ext2fs_extent_get for uninit leaf extents
The ext2fs_extent_get() function was not OR-ing together UNINIT
and LEAF flags in the case where an extent was both; so if we
had an extent which was both uniint and leaf, pass1 would bail
out where depth == max_depth but was not marked as leaf, and
e2fsck (from the next branch) would abort with:

e2fsck 1.40.8 (13-Mar-2008)
Pass 1: Checking inodes, blocks, and sizes
Error1: No 'down' extent
Aborted

Also, if the error is encountered again, print the inode number
to aid debugging until it's properly handled, at least.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:45:27 -04:00
Jose R. Santos 3542ba0d37 Rename feature name from gdt_checksum to uninit_groups
This name is a more intuitive option when running mke2fs.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Jose R. Santos d4f34d41be Add uninit block group support to various libext2fs functions
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:33:12 -04:00
Jose R. Santos ca2634a46a Add initial checksum support for the gdt_checksum/uninit_group feature
- Add support for computing CRC-16 value.
- Add call to check/verify/set csum on block_groups.
- Add a test program to verify csum operations.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20 15:32:11 -04:00
Theodore Ts'o 2d328bb76d Fix miscellaneous gcc -Wall warnings
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-17 23:17:13 -04:00
Andreas Dilger a7c9cb7d0d Add support for the DIR_NLINK feature.
This patch includes the changes required to e2fsck to understand the
nlink count changes made in the kernel.

In e2fsck pass 4, when we fetch the actual link count, if it is
exceeds 65,000 we set the link count to 1.  We silently fix the
situation where the nlink count of the directory is 1, and there are
fewer than 65,000 subdirectories, since since that can happen
naturally.

Patch originally from CFS, significantly rewritten by Theodore Ts'o.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15 01:39:19 -04:00
Theodore Ts'o 60bbd1af53 libext2fs: Make icount use a 32-bit counter
In order to more accurately count the number of directories, which
with the DIR_NLINKS feature can now be greater than 65,000, change
icount to use a 32-bit counter.  This doesn't cost us anything extra
when the icount data structures are stored in memory, since due to
padding for alignment reasons.

If the actual count is greater than 65,500, we return 65,500.  This is
because e2fsck doesn't actually need to know the exact count; it only
needs to know if the number of subdirectories is greater than 65,000.
In the future if someone really needs to know the exact number, we
could add a 32-bit interface.  One isn't needed now, though.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15 01:39:19 -04:00
Theodore Ts'o 6567e5a684 Merge branch 'maint' 2008-03-15 01:27:08 -04:00
Theodore Ts'o a80f3694a7 ext2_fs.h: Rename EXT4_ORPHAN_FS to be EXT3_ORPHAN_FS
No application will ever use the ORPHAN_FS flag, since it only shows
up in kernel memory, but it's been pointed out it was first used in
ext3, and so it should be renamed for accuracy.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15 01:25:51 -04:00
Eric Sandeen 82e541885e Fix ext2fs_swap_inode_full() for in-inode xattrs on big-endian machines
After the fix for resize2fs's inode mover losing in-inode
extended attributes, the regression test I wrote caught
that the attrs were still getting lost on powerpc.

Looks like the problem is that ext2fs_swap_inode_full()
isn't paying attention to whether or not the EA magic is
in hostorder, so it's not recognized (and not swapped)
on BE machines.  Patch below seems to fix it.

Yay for regression tests.  ;)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-03-14 14:32:53 -04:00
Theodore Ts'o 252b736369 libext2fs: Fix fencepost error in ext2fs_extent_insert()
ext2fs_extent_insert() was copying n-1 of the existing extents when
moving things down to make room for the new extent.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-14 10:42:50 -04:00
Theodore Ts'o 83d9be1d5d libext2fs: Fix ext2fs_extent_delete() to always point at a valid entry
When deleting the last entry in a node, back up the current pointer so
it is always pointing at a valid entry.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 23:55:40 -04:00
Jose R. Santos 51b263e369 Add {read,write}_blk64 to inode_io.c
Add 64-bit block capable routines to inode IO manager.  Since fileio.c
does not yet have 64bit support, these routines will not handle 64bit
block numbers correctly yet.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 13:47:05 -04:00
Jose R. Santos 59ecd32dcb Add {read,write}_blk64 to unix_io.c
Add 64-bit block capable routines to Unix IO manager.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 13:46:58 -04:00
Jose R. Santos 3154e1cceb Add 64-bit IO manager operations to struct_io_manager.
In order to provide 64-bit block support for IO managers an maintain
ABI compatibility with the old API, some new functions need to be
added to struct_io_manger.  Luckily, strcut_io_manager has some
reserved space that we can use to add these new functions.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 13:46:44 -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 52b1dd5e49 libext2fs: Add ext2fs_dblist_get_last() and ext2fs_dblist_drop_last()
Add two new functions which allows the caller to examine the last
directory block entry added to the list, and to drop if it necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-13 00:34:16 -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
Theodore Ts'o ab52e12a90 libext2fs: Add EXT2_FLAG_NONFREE_ON_ERROR to ext2fs_open2()
Add a flag which returns the partially completed filesystem object so
e2fsck can print more intelligent error messages.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 20:45:36 -05:00
Theodore Ts'o 7100351d35 libe2p: New e2p_edit_feature2 which provides better error handling
This creates a new enhanced edit_feature function for libe2p which
supports a different set of feature flags that are OK to clear as
opposed to set, and which returns more specific information about why
the user provided an invalid edit feature command.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-26 14:26:01 -05:00
Theodore Ts'o 395529bb46 libe2p: Change Raid to RAID in display option
Update m_raid_opt test so that it reflects the code change.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 16:52:27 -05:00
Valerie Clement e6bbc002c5 Add missing shift for ei_leaf_hi
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:57:34 -05:00
Valerie Clement d46d67a845 Add missing free in ext2fs_extent_free()
handle->path should be freed in ext2fs_extent_free()

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-22 15:56:23 -05:00
Theodore Ts'o 7a3e1b7bff Fix memory leak in ext2fs_alloc_block()
If a block buffer was not supplied and ext2fs_alloc_block() returned
with no errors, it would leak a temporary block buffer.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-19 08:40:27 -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 0157e7c635 Merge branch 'maint' into next 2008-02-18 23:01:43 -05:00
Theodore Ts'o 6b226c3de2 libe2p: Make list_super2() print the RAID stride and stripe-width
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 22:59:42 -05:00
Theodore Ts'o 0c17cb25f2 Add support for setting RAID stride and strip-width via mke2fs and tune2fs
This is useful for mballoc to align block allocation on the RAID
stripe boundaries.

Signed-off-by: Rupesh Thakare <rupesh@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 22:56:25 -05:00
Andreas Dilger fefaef39e0 Improve support for in-inode EA's
Add vertificaton of the in-inode EA information, and allow in-inode
EA's to have a checksum.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 21:20:26 -05:00
Theodore Ts'o 15d482ba6e e2fsck: Add support for extents
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:06:18 -05:00
Theodore Ts'o cc9bf5d246 Add read/only support for extents to ext2fs_bmap()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:05:55 -05:00
Theodore Ts'o 206fea69f8 Add read-only extents support to ext2fs_block_iterate2()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:05:47 -05:00
Theodore Ts'o 3eb07f6493 Add support for extents to libext2fs
Initial implemenation of extents support in libext2fs

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 20:05:35 -05:00
Theodore Ts'o 4ce3b77480 Don't byte swap extents information in the inode
Responsibility for byte swapping the extents information rests with
the low-level extent code, which translates the on-disk extents
information to the abstract extent format.  The on-disk format will
eventually get more complicated, in order to add support for 64-bit
block numbers, bit-compressed extents, etc.  So to avoid needing to
expose all of that complexity in swapfs.c, the in-memory contents of
i_blocks will not be byte-swapped and will be identical to the on-disk
format.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-18 15:27:04 -05:00
Theodore Ts'o bbf54adb03 Merge branch 'maint' into next 2008-02-17 17:36:45 -05:00
Theodore Ts'o 3eed36b254 Update to latest samba tdb library before LGPLv3 change
The major changes were:

* Fix realloc() leak on failure case from Jim Meyering
* Fixed various problems in transaction lock code
* Made transaction_brlock() static
* Added more fine-grained locking features

Moved from svn revision #22080 to #23590

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-17 17:35:54 -05:00
Christophe GRENIER e7cc6f7d0b Add portability checks to support DJGPP
DJGPP lacks sys/select.h and sys/un.h; add header checks to be more
portable.

Signed-off-by: Christophe Grenier <grenier@cgsecurity.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-02-17 17:33:57 -05:00
Theodore Ts'o e70f32b79d libuuid: use fcntl locking instead of lockf
Cygwin doesn't support lockf(), so move to fcntl() locking as more
portable.  Also fix a bug which could cause get_lock() to loop forever
if the attempt to lock the file fails for some reason.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-16 10:05:48 -05:00
Theodore Ts'o 357d1863d6 libext2: Add BLOCK_FLAG_READ_ONLY flag to ext2fs_block_iterate2()
This flag allows the caller to promise that it will not try to modify
the block numbers returned by the iterator.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-10 08:04:09 -05:00
Theodore Ts'o ef80fdc8ad Merge branch 'maint' into next 2008-02-10 08:03:54 -05:00
Theodore Ts'o 47526e3568 libcom_err: Use thread local storage to fix reentrancy problems
Address the theoretical problem of two threads trying to format a
different unknown error code by using TLS.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-02-09 23:49:19 -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 edeee8f36f libuuid: Make sure execl() variadic function is properly terminated
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-27 00:22:52 -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
Theodore Ts'o 6cb27404f5 Add support for the test_fs flag
The test_fs flag is an "ok to be used with test kernel code" flag.  It
makes it easier for us to determine whether a filesystem should be
mounted using ext4 or not.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-26 21:47:40 -05:00
Theodore Ts'o 153439222e Define helper functions ext2fs_set_i_{u,g}id_high() for MacOS compatibility
This is needed for all non-Linux/Hurd/Masix systems...

Addresses-Sourceforge-Bug: #1863819

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-21 09:46:05 -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 42c0b61ca5 Fix profile, checker, and shared-library building on non-Linux platforms
Approximately two years ago a revamp of the e2fsprogs build
infrastructure broke the Makefile fragments for building BSD, Solaris,
and Darwin shared libraries, as well as profiling and checker
libraries.  Apparently no one had noticed except for
pierre42@users.sourceforge.net.

Addresses-Sourceforge-Bug: #1819034

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 16:48:09 -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 7132d48d83 Fix build failure on non-Linux/non-Hurd/non-Masix systems
The previous fix didn't quite work, but this one should!

Addresses-Sourceforge-Bug: #1861633

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 12:25:36 -05:00
Theodore Ts'o 0cfde3d15a libss: Remove unnecessary Makefile dependency for test_ss
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-01 01:19:19 -05:00
Theodore Ts'o 904dad55e6 Update dependencies in lib/uuid/Makefile.in
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 23:12: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 29dd9d1e90 Test for sys/syscall.h in configure to fix dietlibc build problem
When compiling with dietlibc, sys/syscall.h isn't supported; as of
dietlibc 0.30, it exists but it references a non-existent asm/unistd.h
header file.  So we have to test for its existence and avoid using it
in lib/uuid/gen_uuid.c if it is not supported.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34:25 -05:00
Theodore Ts'o 5610f9924b Add --disable-uuidd configure option
Add a configure option which causes the uuidd helper daemon not to be
built or used by the uuid library.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:34:19 -05:00
Theodore Ts'o 3306861158 Fix build failure on non-Linux/non-Hurd/non-Masix systems
inode_uid() and inode_gid() weren't getting defined on systems that
were not Linux, Hurd, or Masix.

Addresses-Sourceforge-Bug: #1859778

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-31 22:33:56 -05:00
Theodore Ts'o e5aace908e Convert use of ext2fs_get_mem to ext2fs_get_array for overflow detection
Add some additional checks, primarily in resize2fs and in the rarely
used (and soon to-be-deprecated) e2fsck byte-swap filesystem function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-27 10:08:13 -05:00
Theodore Ts'o f79fb4976c libuuid: Fix bug which caused uuidd to fail if sizeof(int) != sizeof(int *)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-21 11:32:48 -05:00
Theodore Ts'o 3166c58dc0 Add #define needed for Hurd ioctl definitions
Addresses-Debian-Bug: #437720

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-17 23:03:53 -05:00
Theodore Ts'o d37a4fa788 libuuid: Only try to start the uuidd daemon a limited number of times
If we fail to create the uuidd daemon after 5 or 6 tries, another
10,000 tries probably won't be successful.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-17 15:26:47 -05:00
Theodore Ts'o 9d8c203a46 libuuid: When starting uuidd, use waitpid() to reap the zombie process
The uuidd process will fork and let the parent process exit to create
the daemon.  So use waitpid to reap the zombie, as well as using it to
time when it is safe to try to connect to the daemon.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-17 15:16:44 -05:00
Theodore Ts'o 2165003bd5 uuidd: Use /var/lib/libuuid instead of /var/run/uuidd
/var/run can get completely removed at reboot, and uuidd doesn't have
permissions to recreate /var/run/uuidd.  So instead use
/var/lib/libuuidd for the unix domain socket and pid files.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-17 15:12:04 -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 740837def7 Add uuidd daemon to prevent duplicate time-based UUID's
Also store the clock sequence information in a state file in
/var/lib/misc/uuid-clock so that if the time goes backwards the clock
sequence counter can get bumped.  This allows us to completely
correctly generate time-based (version 1) UUID's according to the
algorithm specified RFC 4122.

Addresses-Sourceforge-Bug: #1529672
Addresses-Red-Hat-Bugzilla: #233471

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-16 17:28:46 -05:00
Theodore Ts'o 6b6c27fb8a libcom_err: Fix sign-extension problem on 64-bit systems in error_message()
On 64-bit systems (or anything with sizeof(long) > sizeof(int)), we
sometimes get error codes passed to error_message which have been cast
from an (int) to an (unsigned int). This almost always happens if
you're using libgssapi_krb5, which returns an error code which is less
than 0 but is returned in an (unsigned int).

For example, -1765328377L gets cast to 2529638919, which is
0x96c73a07, not 0xffffffff96c73a07, so error_message() fails to find a
matching error table.

When error_message() then calls the error_table_name() function to get a
name to use in the "unknown code" message, it gets a correct value back.

This happens because error_table_name() drops most of the higher bits of
the parameter it's passed before doing anything else with it (& 077777777f,
or & 0xffffff). If we did the same thing in error_message(), we wouldn't
have a problem there, either.

Problem reported and fixed by: Nalin Dahyabhai

Addresses-Sourceforge-Bug: #1809658

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:31:03 -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 bef406047d libss: Fix "make check" test case to work portably
The "make check" test in lib/ss would fail if '.' is not in the user's
PATH, and if the libss shared library had not yet been installed yet.

Addresses-Sourceforge-Bug: #1848974

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:09:48 -05:00
Theodore Ts'o daecda1cad Fix uuid_unparse man page to give a correct example UUID output string
Addresses-Debian-Bug: #444883

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 21:13:42 -05:00
Theodore Ts'o 9a083af71a ext2fs_flushfs: Remove the NEEDS_RECOVERY from the backup superblocks
Now that e2fsck tries to backup the primary superblock to the backups
when the feature sets ar different, it's important when tune2fs writes
out a changed superblock, that we filter out the
EXT3_FEATURE_INCOMPAT_RECOVER feature to the backup superblocks, since
it will be removed from the primary superblock either when the
filesystem is mounted uncleanly or when journal is replayed.

Addresses-Debian-Bug: #454926

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

	lib/ext2fs/closefs.c
2007-12-09 17:03:01 -05:00
Theodore Ts'o ee01079a17 libext2fs: Add checks to prevent integer overflows passed to malloc()
This addresses a potential security vulnerability where an untrusted
filesystem can be corrupted in such a way that a program using
libext2fs will allocate a buffer which is far too small.  This can
lead to either a crash or potentially a heap-based buffer overflow
crash.  No known exploits exist, but main concern is where an
untrusted user who possesses privileged access in a guest Xen
environment could corrupt a filesystem which is then accessed by the
pygrub program, running as root in the dom0 host environment, thus
allowing the untrusted user to gain privileged access in the host OS.

Thanks to the McAfee AVERT Research group for reporting this issue.

Addresses CVE-2007-5497.

Signed-off-by: Rafal Wojtczuk <rafal_wojtczuk@mcafee.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-05 21:01:35 -05:00
Theodore Ts'o 1113bf706f libss: Fix parallel build failure
A missing dependency on ss_err.h meant that std_rqs.o could fail when
e2fsprogs was being built using make -j.

Thanks to Robert Kerr for reporting this bug.

Addresses-Sourceforge-Bug: #1842331

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-02 05:52:40 -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
Theodore Ts'o 7e5a86a660 libext2fs: Fix a corner case bug in ext2fs_unlink
We cannot merge a removed directory entry to just arbitrary previous
directory entry. The previous entry must be in the same block.  So
really bad things can happen when are deleting the first directory
entry in a block where the last directory entry in the previous
directory block is not in use.  We fix this bug by checking to see if
the current entry is not the first one in the block before trying to
merge it to the previous entry.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-02 05:25:30 -05:00
Andreas Dilger 8cdd6a6f34 fix check_mntent_file() to pass mode for open(O_CREAT)
On my FC8 install, ismounted.c fails to build because open(O_CREAT) is
used without passing a mode.  The following trivial patch fixes it.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-12-02 05:25:30 -05:00
Theodore Ts'o 33b92836cd Fix errors in test_ss.c so it can be an example application and test case
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-02 05:25:23 -05:00
Theodore Ts'o 5ea565fd37 Merge basic FLEX_BG support
Merge commit 'c2d4300b8a4a13d8a78b86c386f76259f23feec2' into next
2007-11-03 21:01:01 -04:00
Jose R. Santos c2d4300b8a Enable FLEX_BG feature support
Add FLEX_BG as a supported feature bit.

Add support to mke2fs to create filesystems with FLEX_BG.

Add support to tune2fs to add (and remove, if it won't break
filesystem consistency) the FLEX_BG feature.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

 lib/e2p/feature.c   |    2 ++
 lib/ext2fs/ext2fs.h |    6 ++++--
 misc/mke2fs.c       |    7 ++++++-
 3 files changed, 12 insertions(+), 3 deletions(-)
2007-11-03 20:40:56 -04:00
Jose R. Santos 88b34b1f87 Relax group descriptor checking for FLEX_BG
The FLEX_BG feature allows the inode table, block bitmap, and inode
bitmaps to be located anywhere in the filesystem.  Update e2fsck and
libext2fs's checking code to recognize this.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

 e2fsck/super.c          |   14 ++++++++++++--
 lib/ext2fs/check_desc.c |   15 +++++++++++++--
 2 files changed, 25 insertions(+), 4 deletions(-)
2007-11-03 20:13:16 -04:00
Jose R. Santos 4d5cb2ac91 lib/ext2fs/Makefile.in: Reorder some of the $(SRCS) in alphabetical order.
All files under $(OBJS) and $(SRCS) should be in alphabetical order
but this is not always the case.  Let fix some some of these before
applying new files to the list of $(SRCS).

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

 lib/ext2fs/Makefile.in |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
2007-11-03 13:56:56 -04:00
Jose R. Santos cf0eeec015 Reserve the INCOMPAT feature number for FLEX_BG.
Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--

 lib/ext2fs/ext2_fs.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
2007-11-03 12:10:12 -04:00
Theodore Ts'o d9099eec8e Merge branch 'cl/remove-masix' into next 2007-11-01 01:54:22 -04:00
Coly Li c9548bc37e libext2fs: remove masix support
This patch remove masix support from lib/ext2fs.

Signed-off-by: Coly Li <coyli@suse.de>
2007-11-01 01:53:56 -04: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 710bac86a5 texinfo: Fix directory entries
According to texinfo documentation, @dircategory and
@direntry...@end direntry commands are more appropriate.

For details see
http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Installing-Dir-Entries.html

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2007-11-01 00:25:02 -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
Dmitry V. Levin d9039ae0ff Check fgets(3) return value
When fgets() function fails, contents of the buffer is undefined.  That
is, fgets() return value needs to be checked, to avoid undefined behavior.

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 14bd240b46 libe2p: Change iterate_on_dir so that it counts non-zero returns
To allow error messages to be reflected up, if the callback function
returns a non-zero value, bump a counter and return the number of
times the callback function signals an error by returning a non-zero
status code.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-22 08:25:13 -04:00
Theodore Ts'o 1a4ce9df58 libe2p: Use lstat() instead of stat() in fsetflags() and fgetflags()
We can't set the flags on symbolic links, so check for them using
lstat().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-22 08:05:44 -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
Valerie Clement f2de1d38d0 libext2fs: Add EXT2_DESC_SIZE and EXT2_DESC_PER_BLOCK macros
Add macros to support variable-length group descriptors for ext4.

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-14 22:08:35 -04:00
Valerie Clement 5d38ef1d04 libext2fs: cleanup usage of unsigned int or __u32 and replace it with blk_t
Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-14 21:54:28 -04:00
Valerie Clement 3bfca9a499 libext2fs: use ext2fs_group_first_block() instead of open-coded equivalent
Use ext2fs_group_first_block() instead of the open-coded equivalent in
ext2fs_super_and_bgd_loc() and ext2fs_descriptor_block_loc().

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-10-14 18:52:01 -04:00