Commit Graph

3945 Commits (9b01faa8b24909fca2d220efbdc989285796f6c4)

Author SHA1 Message Date
Theodore Ts'o 9b01faa8b2 e2fsck: fix precedence bug in built-in quota support
The operator precedence bug means that we might pay atteion to
s_grp_quota_inum even if the RO_COMPAT_QUOTA feature flag is clear.
However, fortunately, this is unlikely to happen in practice.

Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-21 22:08:13 -04:00
Theodore Ts'o 3b693d0b03 e2fsck: fix 64-bit journal support
64-bit journal support was broken; we weren't using the high bits from
the journal descriptor blocks!  We were also using "unsigned long" for
the journal block numbers, which would be a problem on 32-bit systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-21 21:30:45 -04:00
Theodore Ts'o 108e6581fc tests: fix f_jnl_64bit so that it actually has a 64-bit journal
The previous image did not have a 64-bit journal so it wouldn't
properly test the 64-bit journal format.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-21 11:03:16 -04:00
Theodore Ts'o 8c778b3acd libe2p: teach e2p_jrnl_feature2string() about the 64-bit journal feature
This will allow dumpe2fs to correctly display the 64-bit journal
feature, if it is enabled.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-21 10:59:01 -04:00
Theodore Ts'o 8cf716a251 Update Release Notes, Changelogs, version.h, etc. for 1.42.3 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-14 16:08:47 -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
Theodore Ts'o 40024fdbaf libext2fs: fix bug in unix_io corrupted > 16TB file systems on 32-bit systems
The code was assuming that "unsigned long" was 64-bit, which of course
it isn't on 32-bit systems.  This caused blocks to get written to the
wrong place.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-14 10:55:09 -04:00
Theodore Ts'o ce10c313e6 dumpe2fs: fix 64-bit block numbers on 32-bit systems
Fix bug which caused 64-bit block numbers to be incorrectly printed on
systems with 32-bit longs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-14 01:59:32 -04:00
Theodore Ts'o 183c73b026 Teach build system to install relative symlinks if requested
Add a configure option, --enable-relative-symlinks, which will use
relative symlinks for the ELF shared library files.

Addresses-Sourceforge-Bug: #3520767

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-12 23:34:33 -04:00
Theodore Ts'o e366e42392 Include LDFLAGS when building BSD libraries
Addresses-Sourceforge-Bug: #3517272

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-11 22:21:08 -04:00
Matthias Andree 58b3d8d3ae Fix parallel (make -j) build
Add a few dependencies where needed, so that "make -j17 check" now
works.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-05-11 22:13:29 -04:00
Matthias Andree 21af16f404 Fix bashisms
These break the self-test suite on *BSD, and on some Linux distros
where /bin/sh is not implemented by bash.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-05-11 22:13:21 -04:00
Theodore Ts'o 660b4c3b3f Reserve the codepoints for the INCOMPAT features LARGEDATA and INLINEDATA
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-11 18:39:27 -04:00
Theodore Ts'o d71520751e Support systems without posix_memalign() and memalign()
MacOS 10.5 doesn't have posix_memalign() nor memalign(), but it does
have valloc().  The Android SDK would like to be built on MacOS 10.5,
so I've added support for a good-enough emulation of memalign()'s
functionality using valloc(), with an explicit test to make sure
valloc() is returning a pointer which is sufficiently aligned given
the requested alignment.  This won't work if you try to operate on a
file system with a 16k blocksize using an e2fsprogs built on MacOS
10.5 system, but it is good enough for the common case of 4k
blocksize file systems, and we will let the memory allocation fail in
the alignment is not good enough.

I've also added a unit test for ext2fs_get_memalign() so we can be
sure it's working as expected.  I've tested the code paths with
HAVE_POSIX_MEMALIGN defined, HAVE_POSIX_MEMALIGN undefined, and
HAVE_POSIX_MEMALIGN and HAVE_MEMALIGN undefined on an x86 Linux
system, and so I know the valloc() code path works OK.  The simplistic
(and less safe) patch at:

https://trac.macports.org/attachment/ticket/33692/patch-lib-ext2fs-inline.c.diff

Shows that using valloc() apparently works OK for MacOS 10.5 (but if
it doesn't the unit test will catch a problem).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-11 18:21:08 -04:00
Theodore Ts'o fd1c5a0622 libext2fs: factor out I/O buffer allocation
Create a new function, io_channel_alloc_buf() which allocates I/O
buffers with appropriate alignment if we are using direct I/O.  The
original code was sometimes using a larger alignment factor than
necessary, and would always request an aligned memory buffer even when
it was not necessary since the block device was not opened with
O_DIRECT.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-07 14:41:49 -04:00
Theodore Ts'o 07d120848d libext2fs: make read_bitmaps() more efficient when using direct I/O
Read in a full block for each allocation bitmap, to avoid using a
kernel bounce buffer when using direct I/O.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-07 14:30:31 -04:00
Theodore Ts'o dd0a2679dd libext2fs: refactor Direct I/O alignment requirement calculations
Create a new function, ext2fs_get_dio_alignment(), which returns the
alignment requirements for direct I/O.  This way we can factor out the
code from MMP and the Unix I/O manager.  The two modules weren't
consistently calculating the alignment factors, and in particular MMP
would sometimes use a larger alignment factor than was strictly
necessary.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-07 13:25:44 -04:00
Theodore Ts'o 0a05b90330 libext2fs: move the alignment field from unix_io to the io_manager
The align field which indicated the required data alignment of data
buffers was stored in a field specific to the unix_io manager.  Move
it to the top-level io_channel structure so it can be better
generalized.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-07 12:56:07 -04:00
Theodore Ts'o 65ee799fbe tests: add new tests f_jnl_32bit and f_jnl_64bit
Add regression tests which make sure e2fsprogs understands the current
32-bit and 64-bit journal format.  If a patch breaks the on-disk
format, these tests should warn us about that.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-02 16:28:48 -04:00
Andreas Dilger 2788cc879b e2fsck: quiet harmless inode/blocks errors
Don't consider only an error in the superblock summary as incorrect.
The kernel does not update this field except at unmount time, so
don't print errors during a "-n" run if there is nothing else wrong.
Any other unfixed errors will themselves mark the filesystem invalid.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-24 16:22:48 -04:00
Aditya Kali 7943ccf5f2 e2fsck,libquota: Update quota only if its inconsistent
Currently fsck recomputes quotas and overwrites quota files
whenever its run. This causes unnecessary modification of
filesystem even when quotas were never inconsistent. We also
lose the limits information because of this. With this patch,
e2fsck compares the computed quotas to the on-disk quotas
(while updating the in-memory limits) and writes out the
quota inode only if it is inconsistent.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-24 14:51:54 -04:00
Aditya Kali ec7686e3e7 e2fsck: Fix check for hidden quota files
Currently e2fsck always incorrectly detects that quota inodes
need to be hidden (even if they are already hidden) and
modifies the superblock unnecessarily. This patch fixes the
check for hidden quota files and avoids modifying the
filesystem if quota inodes are already hidden.
Also, zero-out the old quota inode so that next fsck scan
doesn't complain.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-24 14:36:42 -04:00
Zheng Liu 1d520184ee debugfs: cleanup in do_show_debugfs_params
Remove 'out' variable and replace fprintf with printf.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-24 14:33:07 -04:00
Aditya Kali a99145e6ef tune2fs: fix man page indentation
The indentation in tune2fs man page was wrong towards the
end. Also, there was extra '[' in the SYNOPSIS section.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-24 14:26:13 -04:00
Trần Ngọc Quân e67f82660c po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:43 -04:00
Gran Uddeborg f070bf5432 po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:43 -04:00
Jakub Bogusz f64e68e049 po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:43 -04:00
Benno Schulenberg e3ea13783d po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:43 -04:00
Samuel Thibault f35794155a po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:43 -04:00
Philipp Thomas edc733d607 po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:42 -04:00
Petr Pisar b8bb8f7bc6 po: update cs.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-04-22 15:38:42 -04:00
Theodore Ts'o 7a069f1ca9 tests: add new test f_eofblocks
Since we have changed the eofblocks handling in e2fsck (by removing
the need for the EOFBLOCKS_FL flag), we should have a test to check
out how we handle uninitialized and initialized blocks which are exist
beyond i_size, with files that have (and don't have) the EOFBLOCKS_FL.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-10 23:50:37 -04:00
Theodore Ts'o 2743499061 Merge branch 'master' of https://github.com/danielnorberg/e2fsprogs into maint
(The single commit was missing a Signed-Off-By, but it was a trivial
change to a non-source file, so I've accepted it.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-10 13:16:29 -04:00
Daniel Norberg f6243c10db com_err.pc: correct include path
compile_et puts #include <et/com_err.h> in
generated header files so pkg-config --cflags
com_err should provide the path to the directory
containing et/.
2012-04-10 15:24:53 +02:00
Theodore Ts'o f52c1753d4 debian: update debian-policy conformance to 3.9.3
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 15:26:53 -04:00
Theodore Ts'o 3b0018beee Update for Debian 1.42.2-2 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:59:20 -04:00
Theodore Ts'o c1732c5a9a e2fsck.conf.5: add buggy_init_scripts to the man page
We have renamed buggy_init_scripts to accept_time_fudge.  Explain this
so that people who find buggy_init_scripts in older e2fsck.conf files
understand what is going on.

Addresses-Debian-Bug: #646963

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:46:43 -04:00
Theodore Ts'o 46f100707c libext2fs: improve testing coverage of tst_bitmaps
Improve the test coverage of tst_bitmaps by:

   (a) adding the ability to test the legacy (32-bit) bitmap code
   (b) adding tests for ext2fs_find_first_zero_inode_bitmap2() and
       ext2fs_find_first_zero_block_bitmap2()

The recent regressions caused by the addition (and use) of
ext2fs_find_first_zero_inode_bitmap2() would have been caught if we
had added these tests first.  (Another object lesson in why unit tests
are critically important!)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:29:47 -04:00
Theodore Ts'o 38792ca78b libext2fs: use correct types in ext2fs_find_first_zero_block_bitmap2()
Fortunately nothing was using this inline function, so we'll just fix
the types in its function signature, which were nonsensical (this was
caused by a cut-and-paste error).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:29:47 -04:00
Theodore Ts'o 664c332612 libext2fs: add 32-bit compat code for ext2fs_find_first_zero_generic_bmap()
The lack of 32-bit support was causing febootstrap to crash since it
wasn't passing EXT2_FLAG_64BITS when opening the file system, so we
were still using the legacy bitmaps.

Also add support for bigalloc bitmap into the ffz functions.

Addresses-Red-Hat-Bugzilla: #808421

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:29:13 -04:00
Theodore Ts'o 8f92c4a2ff Update config.guess and config.sub to the latest (2012-02-10) version
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 15:45:02 -07:00
Theodore Ts'o b24efa2187 Don't assume that the presence of mntent.h means that setmntent() exists
Change autoconf to test for setmntent() and use that to decide whether
to use getmntent() and setmntent(), since some systems don't have
setmntent() but they do have the mntent.h header file.

Also, remove the includes of mntent.h from e2fsck and mke2fs and other
places where it is not needed.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 15:31:09 -07:00
Theodore Ts'o d47e2af763 fsck: don't include sys/signal.h for portability reasons
It isn't necessary to include sys/signal.h, and it's not available on
all systems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 15:21:49 -07:00
Theodore Ts'o 25ff7725cc e2fsck: add portability fallback in case getpwuid_r is not present
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 15:16:50 -07:00
Theodore Ts'o 304e11c2c1 mke2fs: don't fail creating the journal if /etc/mtab is missing
The ext2fs_add_journal_inode() function calls
ext2fs_check_mount_point(), which can fail if /etc/mtab is missing.
This causes mke2fs to fail in the middle of the file system format
process; mke2fs calls ext2fs_check_mount_point() already (and has
appropriate fallbacks that calls fails), so add a flag so that mke2fs
can request ext2fs_add_journal_inode() to skip trying to call
e2fsck_check_mount_point().

Addresses-Sourceforge-Bug: #3509398

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 12:30:02 -07:00
Theodore Ts'o e64e6761aa Fix gcc -Wall nitpicks
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-05 12:13:05 -07:00
Theodore Ts'o 70d7281dcb Update Release Notes, Changelogs, version.h, etc. for 1.42.2 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-27 16:20:46 -07:00
Trần Ngọc Quân 3e979c68d0 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-03-27 12:02:27 -07:00
Theodore Ts'o ddad03871f debian: add pointer for e2fsprogs-udeb to libcomerr2.shlibs
The udeb for btrfs-tools need libcom_err.so.2, which is packaged as a
part of e2fsprogs-udeb since we don't have a separate libcomerr2 udeb.
So we need to make sure the shlibs file has an explicit pointer to
handle this case.

Addresses-Debian-Bug: #665885

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-27 11:52:32 -07:00
Theodore Ts'o 95decc5c72 debian: add back support older systems w/o dpkg-buildflags
Commit 5d0e1f99 removed support for older systems such as Ubuntu
10.04, which don't have dpkg-buildflags.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-26 22:54:41 -07:00