Commit Graph

5518 Commits (35a4e1b1c5cbb493842be6f901b155a9b4489b12)

Author SHA1 Message Date
Theodore Ts'o 35a4e1b1c5 e2fsck: fix logic for deciding when to repair legacy timestamp encodings
A static code checker noticed that we had a redundant condition:

    if (((sizeof(time_t) <= 4) ||
         ((sizeof(time_t) > 4) &&

which was caused by the parenthesis were in the wrong place.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:54 -04:00
Theodore Ts'o abae029024 po: Add Hugarian and Serbian translations
Also update the .gmo files.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:54 -04:00
Tianze Wang 57d6927dc8 po: update zh_CN.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:54 -04:00
Yuri Chornoivan 935fdb9935 po: update uk.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:54 -04:00
Göran Uddeborg 57bbbb813d po: update sv.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Jakub Bogusz d0c9ac4886 po: update pl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Benno Schulenberg b9e09a9d02 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Samuel Thibault 7ef3cf2489 po: update fr.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Philipp Thomas a4670b9e78 po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Joe Hansen 1e000f89d3 po: update da.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Angel Mompo 60836c6361 po: update ca.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Theodore Ts'o 4d4335323e tune2fs: tell the user that e2fsck -f is required
The message requesting that the user run e2fsck doesn't include the -f
option, and this is needed to force a file system check.

Addresses-Debian-Bug: #828022

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Theodore Ts'o c4d54aa2f7 e2fsck: fix an alignment problem which causes sparc64 in the journal code
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:53 -04:00
Theodore Ts'o 22137497fa debugfs: fix typo when printing out the dtime label
If the inode has extended timestamps, the dtime was printed with a
label of "crtime".  Fix this.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-09-01 01:01:48 -04:00
Theodore Ts'o b199291909 debugfs: add the debugfs copy_inode subcommand
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-31 18:13:16 -04:00
Theodore Ts'o 9a23fa8334 Merge branch 'maint' into next 2016-08-10 18:53:14 -04:00
Andreas Dilger 713edbd082 fsck: fix strange logic
llvm warns about the confusingly written comparison:

                              !strncmp(argv[i+1], "-", 1) == 0) {
    misc/fsck.c:1178 col 9: warning: logical not is only applied to
      the left hand side of comparison [-Wlogical-not-parentheses]
    misc/fsck.c:1178 col 9: note: add parentheses after the '!' to
      evaluate the comparison first
    misc/fsck.c:1178 col 9: note: add parentheses around left hand
      side expression to silence this warning

It makes sense to simplify this to a character comparison rather
than using strncmp() to check only one character.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 18:21:19 -04:00
Adrien Schildknecht 4ccf9e4fe1 libext2fs: add unixfd_io_manager
This new manager is similar to the unix_io_manager except it takes a
file descriptor as first argument instead of a filename.

Some programs may want libext2fs to directly use a fd instead of
letting it opening the file.
The use case for such a io_manager would be to let programs use
a fd even if the filename is unknown:
  - the fd comes from a temporary file (O_TMPFILE);
  - the fd comes from a unix socket...

Refactoring unix_open() also fix a bug when the IO_DIRECT flag was
specified: ext2fs_get_dio_alignment() was called before the file was
actually opened, resulting in an alignment of 0.

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 17:08:16 -04:00
Adrien Schildknecht d4e5abfb1b libext2fs: replace 'unsigned long' by 'uintptr_t'
This is needed for win64:
    sizeof(unsigned long) != sizeof(void*)

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 17:07:00 -04:00
Adrien Schildknecht 5cc6db0c82 libext2fs: reset the size of the zeroing buffer
When a ext2_filsys is freed, ext2fs_zero_blocks2() frees the buffer but
does not reset its size.
If this function is later called with a new ext2_filsys, the code
assumes that the buffer is still valid and return a NULL pointer.

Valgrind output:
==188948== Syscall param pwrite64(buf) points to unaddressable byte(s)
==188948==    at 0x4E46D03: __pwrite_nocancel (syscall-template.S:81)
==188948==    by 0x1254EC: raw_write_blk (unix_io.c:240)
==188948==    by 0x124AAB: unix_write_blk64 (unix_io.c:850)
==188948==    by 0x122893: ext2fs_zero_blocks2 (mkjournal.c:204)

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 16:43:25 -04:00
Theodore Ts'o 3d6fc97483 resize2fs: fix crash when there is an ea block and no blocks to migrate
This fixes a bug introduced in 1.43 by commit fb47b94fffc: "resize2fs:
rewrite extent/dir/ea block checksums when migrating".  If there is an
extended attribute block and there are no blocks that need to migrate,
we will crash.

The bug was caused by a botched De Morgan's transformation.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 16:00:17 -04:00
Matthias Andree c2c5c58593 libext2fs: fix infinite loop if copying in an empty directory
In m_minrootdir, on FreeBSD 9.3, try_lseek_copy() fails on an empty file
because errcode is uninitialized and the while() loop never executes,
and the errcode garbage is returned.

Initialize errcode = 0 in try_lseek_copy() to avoid a "fail" result when
there was nothing to copy.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-07-23 12:40:17 -04:00
Daeho Jeong 32448f50df e2fsck: update j_tail_sequence after recovery
When journal is released, s_sequence is set to j_tail_sequence.
But, currently, even if the recovery process is successfully completed,
the j_tail_sequence and, finally, s_sequence are never changed. By this,
when we repeat doing power-off the device suddenly and executing e2fsck
without full scan before mount, the s_sequence number will never change
and, in a very rare case, newly generated journal logs will be
surprisingly grafted to the old journal logs. In this case, out-of-date
metadata log can be replayed on the filesystem area and the filesystem
can be crashed unintentionally by journal recovery process. Therefore,
we need to update j_tail_sequence after recovery process is successfully
completed in e2fsck.

Youngjin had repeated this test and found the problem. With our test,
the filesystem crash occurred within 4 hours.

Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-07-05 23:10:21 -04:00
Gustavo Zacarias 49aa3ff1f1 fuse2fs: needs SYSLIBS
It otherwise leads to build failure when using an unbundled libintl.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-07-05 22:59:45 -04:00
Theodore Ts'o c94da0475a Update configure script to reflect changes from commit 62bc243f1b
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-21 23:16:39 -04:00
Eric Sandeen 32bf36dc0f e2undo: fix endian issues
Two new e2undo issues exist in the latest release on big endian
machines.

From sparse check:

undo_io.c:157:26: warning: invalid assignment: |=
undo_io.c:157:26:    left side has type restricted __le32
undo_io.c:157:26:    right side has type int
undo_io.c:161:26: warning: invalid assignment: &=
undo_io.c:161:26:    left side has type restricted __le32
undo_io.c:161:26:    right side has type int

e2undo.c:211:16: warning: cast to restricted __le64
e2undo.c:211:16: warning: cast from restricted blk64_t
e2undo.c:212:16: warning: cast to restricted __le64
e2undo.c:212:16: warning: cast from restricted blk64_t

Addresses-RedHat-Bugzilla: 1344636
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-21 23:10:40 -04:00
Theodore Ts'o 5eca88c1dc debugfs: fix logdump to work on files > 2GB
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-12 21:42:47 -04:00
Ingo Brückl 7bd03cf6a1 misc: don't unconditionally install manual page for fuse2fs
Only install the manual page if fuse2fs itself will be installed.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-09 16:56:50 -04:00
Gustavo Zacarias 62bc243f1b fuse2fs: might need librt
It uses clock_gettime() which in older glibc versions is in librt.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-09 16:56:15 -04:00
Theodore Ts'o 48203a389d Update release notes, etc. for 1.43.1 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-08 15:45:26 -04:00
Matthias Andree 434413ccde libblkid: avoid DIOCGDINFO where missing.
FreeBSD 11 will remove the DIOCGINFO ioctl(), so check if it is defined
before referencing it.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-08 14:26:38 -04:00
Theodore Ts'o c0495d96fd Remove the last of behaviour-specific checks on EXT2_OS_LINUX
If there is a feature check, we can just depend on the feature check.
If it is something that can't be checked via a feature flag, then
instead of checking for EXT2_OS_LINUX, we should instead check for
*NOT* EXT2_OS_HURD. since HURD is the special case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 13:36:47 -04:00
Theodore Ts'o 726b21b5d2 tests: suppress use of libmagic when running the regression test suite
How libmagic will behave is not necessarily stable across different
operating systems of versions of libmagic (or the magic number
database).  So suppress it to avoid false test failures.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 12:46:24 -04:00
Theodore Ts'o 55e8032363 tests: disable some tests for FreeBSD
Unfortunately, FreeBSD doesn't support sparse files in their tmpfs,
and they generlaly don't mount a tmpfs on /tmp anyway.  As a result
certain tests will either OOM kill a FreeBSD (if tmpfs is in use) or
will take forever (if it is not in use).

So let's turn off some tests for FreeBSD (m_hugefile is disabled on
MacOS already, for similar reasons).  We need to find a better
solution in the long term, but for now, these tests are guaranteed to
be a disaster on FreeBSD, so suppress them for now.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 11:52:25 -04:00
Theodore Ts'o 81f965a04d tune2fs,resize2fs: special case HURD only when testing s_creator_os
The s_creator_os field was a mistake, given how Hurd has been
ab(using) certain file system fields.  We should skip support for
certain advanced features (64-bit support, metadata checksums) for
file systems created on the Hurd OS only, instead of only supporting
them for file systems created on Linux.  This fixes various regression
test failures for FreeBSD.

(The regression tests are probably mostly hopeless for Hurd anyway,
but given the HURD abuse's of various file system fields, the HURD is
going to have to be given second-class treatment in any case, given
what they decided to do with ext2 support, which locks them out of the
more advanced file system features, anyway.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 11:47:40 -04:00
Theodore Ts'o 43b7b054cd libext2fs: fix EXT2FS_PRETEND_* on non-Linux systems
The debugging environment variables EXT2FS_PRETEND_* were implemented
in check_mntent_file(), and this function isn't called on all
operating systems.  Lift this code up to ext2fs_check_mount_point(),
so that these environment variables (which are used in the regression
test suite) will work on all platforms.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 11:44:54 -04:00
Matthias Andree afaf6db69f Fix dbg_print() format for unsigned long long.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 10:50:12 -04:00
Theodore Ts'o ded919125a tests: teach test_script the --failed option
Teach test_script the --failed option, which asks it to rerun the
tests that had previously failed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 10:47:20 -04:00
Theodore Ts'o 3166e2e540 libext2fs: don't use $(LDFLAGS_STATIC) when linking test programs
The tst_* progams aren't intended to be linked 100% stically; they
just link against some of the static libraries.  So use $(ALL_LDFLAGS)
and not $(LDFLAGS_STATIC).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 01:01:45 -04:00
Theodore Ts'o 32179ce25b configure: fix detection of dlopen() for BSD systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-07 01:01:37 -04:00
Theodore Ts'o 770d9f5e28 Merge branch 'maint' into next 2016-06-07 01:01:22 -04:00
Theodore Ts'o 127e2291bf libext2fs: fix Direct I/O fallback code so it implements RMW correctly
There is a bug in Unix I/O manager where if an aligned I/O is
required, it does not correctly do the read-modify-write cycle
correctly.  Specifically, it was not doing an lseek between the read
and the write calls, so the update was going to block N+1 instead of
block N.  Oops.

Fortunately in practice we almost never use this fallback path, so
file systems weren't getting horribly corrupted, because (a) we almost
never use Direct I/O in e2fsprogs, at least not by default, and (b)
when we do the buffers end up being aligned anyway, so it's OK.

We only noticed this because the new Undo I/O manager in e2fsprogs
1.43 was doing unaligned I/O and FreeBSD requires that I/O requests be
aligned even if you are not doing Direct I/O, and the e2undo
regression tests were all failing as a result.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 23:04:43 -04:00
Theodore Ts'o be05f60ecf tests,debugfs: ea_set's "-f <value_file" needs to be before the other args
For systems that don't use GNU's getopt(3), options have to be before
all non-option arguments.  So change the usage message for debugfs's
ea_set command, and then fix the d_xattr_sorting test.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 16:49:37 -04:00
Theodore Ts'o 7618802123 e2undo: #include <libgen.h> since we use basename()
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 16:19:11 -04:00
Matthias Andree 254c50ff5f tests: use tar xf -, some tars default to tape dev.
FreeBSD's tar defaults to reading from /dev/sa0 when no -f option is
given, so turn "tar x" into "tar xf -" on j_corrupt_ext_jnl_sb_*.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-06 00:54:11 -04:00
Theodore Ts'o 2832fd8b8f mke2fs: warn if user provides a label which is too long
Addresses-Debian-Bug: #791630

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-05 23:18:30 -04:00
Theodore Ts'o edc7b0988a debugfs: clarify man page for the -b and -s options
Addresses-Debian-Bug: #766379

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 23:37:28 -04:00
Theodore Ts'o 97b7a94679 Add clarifications to the e4defrag and resize2fs man pages
Addresses-Debian-Bug: #761144
Addresses-Debian-Bug: #770750

Signed-off-by: Theodore Ts'o <tytso@mit.edu>

by 1 commit.
2016-06-03 23:28:33 -04:00
Theodore Ts'o 50a6f4a2cf Document when ext2/3/4 features were added to the kernel
Document when ext2/3/4 features were added to the kernel in the
ext4(5) man page.

Addresses-Debian-Bug: #428361

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 23:09:58 -04:00
Pete Haddow f8a801d05f Clarify and clean up the ext4(5) man page
Signed-off-by: Pete Haddow <pete@leptonyx.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-06-03 13:44:41 -04:00