Commit Graph

5522 Commits (a2143b51605931db28ba3d5f18f06a73c265287b)

Author SHA1 Message Date
Theodore Ts'o b42b7bae73 Merge branch 'maint' into next 2016-03-21 13:21:03 -04:00
Theodore Ts'o 8f6f8602dc libext2fs: make sure ismounted.c explicitly pulls in <sys/types.h>
The major() cpp macro is defined as requiring sys/types.h to be
included with _BSD_SOURCE defined.  However, in older glibc's this
hasn't been strictly required and the stdlib.h header file included
sys/types.h implicitly.  Fix this so that more aggressive
distributions run into build errors.

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

in with andchanges. Lines starting
2016-03-21 13:09:54 -04:00
Theodore Ts'o 31ddef52ba Fix warnings caused by glibc 2.20
Glibc has depcreated _SVID_SOURCE and _BSD_SOURCE in favor of
_DEFAULT_SOURCE.  So define _DEFAULT_SOURCE to shut up glibc 2.20

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-21 13:05:25 -04:00
Theodore Ts'o 37000b0245 libsupport: fix potential resource leaks in the profile code
These were found by Coverity.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 17:14:15 -04:00
Theodore Ts'o 25040c0431 chattr: fix verbose message while setting the project id
This was caused by a cut and paste error.  (Thanks to Coverity for
pointing this out).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:49:51 -04:00
Theodore Ts'o 855c5e0dfb util: add get-var script
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:29:19 -04:00
Theodore Ts'o e1eee3e13e Android.mk: add missing source files from lib/e2p/Android.mk
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:24:53 -04:00
Theodore Ts'o a96aa32505 libsupport: fix function prototype for parse_quota_opts
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:11:53 -04:00
Theodore Ts'o 9c05bb9fba tune2fs: don't include journal recovery when building for Android
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 16:07:34 -04:00
Theodore Ts'o f5b69d4ad1 Android.mk: fix up the library -host naming convention change
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 15:24:39 -04:00
Theodore Ts'o dd9a866b08 fuse2fs.1: add manual page for fuse2fs
Also add libfuse-dev to the Debian build depends so that fuse2fs gets
built for Debian.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 15:23:35 -04:00
Theodore Ts'o 82e48fb163 Fix various clang and gcc -Wall warnings
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-18 12:45:19 -04:00
Theodore Ts'o 17ea174a75 libext2fs: fix build failure in lib/ext2fs/swapfs on big-endian systems
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-17 22:39:10 -04:00
Theodore Ts'o e3760b72c6 Update lib/ext2fs/Makefile.in using "make depend"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:50:40 -04:00
Theodore Ts'o 9e78ef7288 Update translation template file
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:49:00 -04:00
Theodore Ts'o 526f554c99 Update release notes for a 1.43-WIP release (14-Mar-2016)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:37:28 -04:00
Theodore Ts'o f8fd2fdc1e debian: update debian policy conformance to 3.9.7
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:30:55 -04:00
Alex Deymo 205593f65b Android.mk: Replace _host suffix with more standard -host suffix
Most libraries use the "-host" suffix when building for the host. This
patch renames all the libraries to use -host instead of _host.

Addresses-Google-Bug: #24619596
TEST=make dist

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:25:11 -04:00
Theodore Ts'o 2ab53829a2 configure.ac: fix up Debian naming scheme for its orig.tar.gz file
We are using a new convention for the 1.43-WIP releases which should
be less confusion by replacing the hyphens by periods (e.g.,
1.43~WIP.2016.03.06 instead of 1.43~WIP-2016-03-06).  This avoids
confusion regarding the debian release number (which uses the last
hyphen in the version string to separate the upstream version from the
release number).

Also fix a typo in the version number used in the debian changelog and
e2fslibs.symbols file.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 01:24:44 -04:00
Damien Miller 9dd404897d gen-android-files: create the MODULE_LICENSE_GPL and README.version files
These package version metadata files will be used for automated
notification of external vulnerability reports in Android.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-15 00:45:03 -04:00
James Hawkins 1598731833 libuuid: Silence warnings in lib/uuid when building on Android
-Wno-unused-function
-Wno-unused-parameter

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 19:04:48 -04:00
Mark Salyzyn cd26dc101c Android.mk: export uuid/uuid.h
Addresses-Google-Bug: #23181629
Addresses-Google-Bug: #24133481

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 18:41:45 -04:00
Alex Deymo 5eeb0cca33 libext2fs: export the library include path
When adding 'libext2fs' as a library dependency from any other binary,
the binary needs to find the library headers. Users of this library
should not hard-code the include path themselves. This patch exports the
library headers on all three version of the libext2fs library and
removes the redundant include path from executables in e2fsprogs.

Addresses-Google-Bug: #23084776
TEST=mma

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 18:39:48 -04:00
Jeff Sharkey 7c33c8899f blkid: add support to recognize f2fs to blkid
We can now identify f2fs filesystems and extract the UUID.

Addresses-Google-Bug: #20275581

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 18:39:13 -04:00
Ying Wang d8d67ec7d9 Cleanup Obsolete LOCAL_PRELINK_MODULE
Addresses-Google-Bug: #18675947

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 18:38:43 -04:00
Tao Bao 4ccb2366d8 Wrap tune2fs.h to be C++ compatible
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 18:38:26 -04:00
Theodore Ts'o c733f9987e Rename COPYING to NOTICE and add MODULE_LICENSE_GPL file
The NOTICE and MODULE_LICENSE_GPL files is the convention used by
Android's Open Source Project.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 14:50:37 -04:00
David Turner 082ed5dcd9 e2fsck: correct ext4 dates generated by old kernels
Older kernels on 64-bit machines would incorrectly encode pre-1970
ext4 dates as post-2311 dates.  Detect and correct this (assuming the
current date is before 2242).

Include tests for this, as well as changes to debugfs to correctly
set crtimes.

Signed-off-by: David Turner <novalis@novalis.org>
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 13:57:33 -04:00
Theodore Ts'o 6743215bff debugfs: fix a bug in string_to_time() which misparsed @NNNNNNN inputs
Thanks to David Turner <novalis@novalis.org> for reporting this bug.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 13:54:41 -04:00
Theodore Ts'o cffde0375c Update release notes and debian changelog
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-14 12:50:45 -04:00
Theodore Ts'o 69df84967f fuse2fs: improve command-line parsing
Use libfuse's command line parsing, which is much more powerful and
flexible than what we had before, and to allow the user to have more
fine-grained control over FUSE's run-time options.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-12 02:13:34 -05:00
Eric Whitney 5b7afaf181 e2fsck: fix problem report typo
Remove the stray left parenthesis.  Observed while testing bigalloc_1k
filesystems with shared/298 on 32 bit ARM running 4.3 kernels.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-03-06 22:05:43 -05:00
Eric Sandeen f3745728bc resize2fs: clear uninit BG if allocating from new group
If resize2fs_get_alloc_block() allocates from a BLOCK_UNINIT group, we
need to make sure that the UNINIT flag is cleared on both file system
structures which are maintained by resize2fs.  This causes the
modified bitmaps to not get written out, which leads to post-resize2fs
e2fsck errors; used blocks in UNINIT groups, not marked in the block
bitmap.  This was seen on r_ext4_small_bg.

This patch uses clear_block_uninit() to clear the flag,
and my problem goes away.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 21:51:23 -05:00
Theodore Ts'o 96fae8869c tests: fix missing cleanup of temporary files
A number of tests weren't properly cleaning their temp files.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 21:44:43 -05:00
Theodore Ts'o 6d4bb11487 Merge branch 'maint' into next 2016-03-06 21:30:07 -05:00
Andreas Dilger 539d3ae3da misc: replace comparison macros with inline functions
Replace the EXT2FS_RB_EMPTY_ROOT(), EXT2FS_RB_EMPTY_NODE(),
EXT2FS_RB_CLEAR_NODE(), IS_BLOCK_BM(), IS_INODE_BM(), and
IS_INODE_TB() macros with static inline functions to avoid
suprious compiler warnings with clang:

	pass1.c:618:28: warning: equality comparison with extraneous
		parentheses [-Wparentheses-equality]
	if ((*((__u32 *)(entry)) == 0UL)) {
             ~~~~~~~~~~~~~~~~~~~~^~~~~~
	pass1.c:618:28: note: remove extraneous parentheses
		around the comparison to silence this warning
	if ((*((__u32 *)(entry)) == 0UL)) {
				 ^~
	pass1.c:618:28: note: use '=' to turn this equality
		comparison into an assignment
	if ((*((__u32 *)(entry)) == 0UL)) {
				 ^~
				 =

The static inline functions should compile identically, and allow
some extra compile-time checking for the arguments over macros.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 21:23:40 -05:00
Theodore Ts'o 82af19ea20 tests: cleanup tmpfile for the f_extent_htree
The interim hack to allow this test to work for the maint branch ends
up leaving the tmpfile around.  Clean this up.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 21:22:13 -05:00
Theodore Ts'o dcb8e1fa04 Merge branch 'maint' into next 2016-03-06 20:37:49 -05:00
Darrick J. Wong c864b9eb50 tune2fs: recover the journal
If the journal needs to be recovered to avoid clobbering whatever
changes tune2fs makes, do so.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 62e0d34b51 tune2fs: confirm dangerous operations
Give admins a short amount of time to confirm that they want to
proceed with a dangerous operation.  Refuse to perform the op
unless the filesystem is freshly checked.

Cc: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong ba380eea99 libext2fs: sort keys for xattr blocks
Richard Purdie reports that libext2fs doesn't sort attribute keys in
the xattr block correctly, causing the kernel to return -ENODATA when
querying attributes that should be there.  Therefore, sort attributes
so that whatever ends up in the xattr block is sorted according to
what the kernel expects.

Cc: Darren Hart <dvhart@linux.intel.com>
Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Tested-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 84244683c0 filefrag: accommodate holes when calculating expected values
Currently, filefrag's "expected physical block" column expects extent
records to be physically adjacent regardless of the amount of logical
block space between the two records.  This means that if we punch a
hole in a file, we get reports like this:

ext:   logical_offset:   physical_offset: length:  expected: flags:
4:     4096..    8343:   57376..  61623:   4248:
5:     8345..   10313:   61625..  63593:   1969:   61624:

Notice how it expects 8345 to map to 61624, and scores this against
the fragmentation of the file.  Flagging this as "unexpected" is
incorrect because the gap in the logical mapping is exactly the same
size as the gap in the physical extents.

Furthermore, this particular mapping leaves the door open to the
optimal mapping -- if a write to block 8344 causes it to be mapped to
61624, the entire range 4096-10313 can be mapped with a single extent.
Until that happens, there's no way to combine extents 4 and 5 because
of the gap in the logical mapping at block 8344.

Therefore, tweak the extent report to account for holes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 2b8772f522 tests: check proper operation of metadata_csum_seed
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 1b7623b822 mke2fs: store checksum seed at format time
Allow users to turn on metadata_csum_seed at format time so that UUIDs
can be live-changed at any time.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 17f2fbf737 e2fsck: check the checksum seed feature flag is set correctly
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:53 -05:00
Darrick J. Wong 2be9cd8655 tune2fs: allow user to turn on saving the checksum seed
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:52 -05:00
Darrick J. Wong 2ed0adbce6 libext2fs: store checksum seed in superblock
Allow the filesystem to store the metadata checksum seed in the
superblock and add an incompat feature to say that we're using it.
This enables tune2fs to change the UUID on a mounted metadata_csum
FS without having to (racy!) rewrite all disk metadata.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:52 -05:00
Theodore Ts'o f3d9ac36a0 debugfs: add support for the project id field
Teach the stat and set_inode_field commands to support the project ID
field.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:52 -05:00
Theodore Ts'o ccf028f2e7 libe2p: add missing f[gs]etproject.c files
Li Xi's patch was missing the sources for fgetproject.c and
fsetproject.c.  I've created replacement files which will service the
purpose.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:52 -05:00
Li Xi 3627e83830 Add project ID support for chattr/lsattr
Chattr and lsattr can be used to set or get project ID:
chattr -p <project id> file
lsattr -p file

Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-03-06 20:08:45 -05:00