Whamcloud - gitweb
tools/e2fsprogs.git
3 years agoLU-13197 e2fsck: consistently use ext2fs_get_mem() 41/37441/7 v1.45.2.wc2-lustre v1.45.2.wc2
Andreas Dilger [Wed, 5 Feb 2020 04:35:01 +0000 (21:35 -0700)]
LU-13197 e2fsck: consistently use ext2fs_get_mem()

Consistently use ext2fs_get_mem() and ext2fs_free_mem() instead of
calling malloc() and free() directly in e2fsck.  In several places
it is possible to use ext2fs_get_memzero() instead of explicitly
calling memset() on the memory afterward.

This is just a code cleanup, and does not fix any specific bugs.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1c0943da43299c187936bb28db5423ce3e3ebbe5
Reviewed-on: https://review.whamcloud.com/37441
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
3 years agoLU-13197 e2fsck: fix overflow if more than 4B inodes 40/37440/6
Andreas Dilger [Wed, 5 Feb 2020 03:59:39 +0000 (20:59 -0700)]
LU-13197 e2fsck: fix overflow if more than 4B inodes

Even though we don't have support for filesystems with over 4B inodes
in the current e2fsprogs, this may happen in the future.  There are
latent overflow bugs when calculating the number of inodes in the
filesystem that may as well be fixed now, rather than waiting for it
to be hit in the field at some point.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Change-Id: I336ca04fe8f944dbfbe5425ce84e7d92743ebbe5
Reviewed-on: https://review.whamcloud.com/37440
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
3 years agoLU-13197 misc: handle large files with filefrag 39/37439/6
Andreas Dilger [Wed, 5 Feb 2020 03:54:03 +0000 (20:54 -0700)]
LU-13197 misc: handle large files with filefrag

Avoid overflowing the column-width calc when printing files over 4B blocks.

Document the availability of [KMG] suffixes for the "-b <blocksize>" option.
The blocksize is limited to at most 1GiB blocksize to avoid shifting all of
the extents down to zero GB in size.  Even the use of 1GB blocksize is a bit
tenuous, but some filesystems may multi-GB extents beyond ext4.

Change-Id: I003a721a3d199b1cb8b3912236328eb80b34f0fe
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-on: https://review.whamcloud.com/37439
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
3 years agoLU-13197 e2fsck: reduce memory usage for directories 43/37443/6
Andreas Dilger [Wed, 5 Feb 2020 04:59:26 +0000 (21:59 -0700)]
LU-13197 e2fsck: reduce memory usage for directories

Pack struct dx_dir_info and dx_dirblock_info properly in memory, to
avoid holes, and fields are not larger than necessary.  This reduces
the memory needed for each hashed dir, according to pahole(1) from:

    struct dx_dir_info {
        /* size: 32, cachelines: 1, members: 6 */
        /* sum members: 26, holes: 1, sum holes: 2 */
        /* padding: 4 */
    };

    struct dx_dirblock_info {
        /* size: 56, cachelines: 1, members: 9 */
        /* sum members: 48, holes: 2, sum holes: 8 */
        /* last cacheline: 56 bytes */
    };

to 8 bytes less for each directory and directory block, and leaves
space for future use if needed (e.g. larger numblocks):

    struct dx_dir_info {
        /* size: 24, cachelines: 1, members: 6 */
        /* sum members: 20, holes: 1, sum holes: 4 */
        /* bit holes: 1, sum bit holes: 7 bits */
    };

    struct dx_dirblock_info {
        /* size: 48, cachelines: 1, members: 9 */
    };

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ibe19e9f7e6edb3df7029fffe5e2cecc68c3ebbe5
Reviewed-on: https://review.whamcloud.com/37443
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
3 years agoLU-13197 debugfs: print inode numbers as unsigned 42/37442/6
Andreas Dilger [Wed, 5 Feb 2020 04:39:17 +0000 (21:39 -0700)]
LU-13197 debugfs: print inode numbers as unsigned

Print inode numbers as unsigned values, to avoid printing negative
numbers for inodes above 2B.

Flags should be printed as hex instead of signed decimal values.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4f3b318016bc5ff5915967a616a7a92ef83ebbe5
Reviewed-on: https://review.whamcloud.com/37442
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
3 years agoLU-13197 debugfs: allow comment lines in command file 38/37438/6
Andreas Dilger [Tue, 4 Feb 2020 22:35:01 +0000 (15:35 -0700)]
LU-13197 debugfs: allow comment lines in command file

Allow comment lines with '#' at the start of the line in the command file
passed in to debugfs via the "-f" option or from standard input.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9284a254104f355b0bac4c676ae85cbed63ebbe5
Reviewed-on: https://review.whamcloud.com/37438
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
3 years agoLU-13197 e2fsck: avoid mallinfo() if over 2GB allocated 36/37436/7
Andreas Dilger [Wed, 5 Feb 2020 03:17:42 +0000 (20:17 -0700)]
LU-13197 e2fsck: avoid mallinfo() if over 2GB allocated

Don't use mallinfo() for determining the amount of memory used if it
is over 2GB.  Otherwise, the signed ints used by this interface can
can overflow and return garbage values.  This makes the actual amount
of memory used by e2fsck misleading and hard to determine.

Instead, use brk() to get the total amount of memory allocated, and print
this if the more detailed mallinfo() information is not suitable for use.

There does not appear to be a mallinfo64() variant of this function.
There does appear to be an abomination named malloc_info() that writes
XML-formatted malloc stats to a FILE stream that would need to be read
and parsed in order to get these stats.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: If38984cd31b96a8115206f422931a7c0303ebbe5
Reviewed-on: https://review.whamcloud.com/37436
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
3 years agoLU-13197 e2fsck: avoid overflow with very large dirs 37/37437/6
Andreas Dilger [Tue, 4 Feb 2020 22:35:01 +0000 (15:35 -0700)]
LU-13197 e2fsck: avoid overflow with very large dirs

In alloc_size_dir() it multiples signed ints when allocating the
buffer for rehashing an htree-indexed directory.  This will overflow
when the directory size is above 4GB, which is possible with largedir
directories having about 100M entries, assuming an average 3/4 leaf
fullness and 24-byte filenames, or fewer with longer filenames.
The same problem exisgs in get_next_block().

Similarly, the out_dir struct used a signed int for the number of
blocks in the directory, which may result in a negative size if the
directory is over 2GB (about 50M entries or fewer).

Use appropriate unsigned variables for block counts, and use larger
types for calculating the byte count for memory offsets/sizes.

Such large directories not been seen yet, but are not too far away.
The ext2fs_get_array() function will properly calculate the needed
memory allocation, and detect overflow on 32-bit systems.
Add ext2fs_resize_array() to do the same for array resize.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9382ebfa7491055b0bac4c676ae85cbed63ebbe5
Reviewed-on: https://review.whamcloud.com/37437
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
3 years agoLU-13197 e2fsck: use proper types for variables 24/37424/7
Andreas Dilger [Tue, 4 Feb 2020 06:24:50 +0000 (23:24 -0700)]
LU-13197 e2fsck: use proper types for variables

Use ext2_ino_t instead of ino_t for referencing inode numbers.
Use loff_t for offsets instead of off_t to avoid 32-bit overflow.
Use unsigned int for flags so that they are not negative numbers.

Cast int products to ssize_t before multiplication to avoid overflow.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Change-Id: Iaeaea8cb8b38902aefd1f4e9919d17fbe23ebbe5
Reviewed-on: https://review.whamcloud.com/37424
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
3 years agoLU-13197 e2fsck: fix e2fsck_allocate_memory() overflow 23/37423/7
Andreas Dilger [Tue, 4 Feb 2020 05:32:12 +0000 (22:32 -0700)]
LU-13197 e2fsck: fix e2fsck_allocate_memory() overflow

e2fsck_allocate_memory() takes an "unsigned int size" argument, which
will overflow for allocations above 4GB.  This happens for dir_info
and dx_dir_info arrays when there are more than 350M directories in a
filesystem, and for the dblist array above 180M directories.

Also, in some places inode numbers are "int" instead of "ext2_ino_t",
which can also cause problems with the array size calculations, and
makes it hard to identify where inode numbers are used.

Fix e2fsck_allocate_memory() to take an "unsigned long" argument so
that it can do single memory allocations larger than 4GB.  Change
variables that hold inode numbers to be ext2_ino_t, and print them as
unsigned values instead of signed.

There is also a risk of overflow during the binary search in both
e2fsck_get_dir_info() and e2fsck_get_dx_dir_info() when the midpoint
of the array is calculated, if there would be more than 2B directories
in the filesystem and working above the half way point.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: If6624feb391be2ebf2ddfa46f62a0d2b3f3ebbe5
Reviewed-on: https://review.whamcloud.com/37423
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
3 years agoLU-13197 misc: update build version to 1.45.2.wc2 89/37489/4
Andreas Dilger [Sat, 8 Feb 2020 14:57:55 +0000 (07:57 -0700)]
LU-13197 misc: update build version to 1.45.2.wc2

Update build version to 1.45.2.wc2.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I116ef8bdddde375b5ed448eb480c1759253ebbe5
Reviewed-on: https://review.whamcloud.com/37489
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
3 years agoATM-1754 tests: skip f_large_dir on aarch64 93/38693/2
Andreas Dilger [Thu, 21 May 2020 20:57:49 +0000 (14:57 -0600)]
ATM-1754 tests: skip f_large_dir on aarch64

Skip the f_large_dir test on the aarch64 builders because this is
extremely slow (90 minutes) and clogs up the build system when
there are many patches in the queue.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I8c3a588c34caae5332b4c643df940b0e855cab07
Reviewed-on: https://review.whamcloud.com/38693
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
4 years agoLU-11643 libext2fs: don't use O_DIRECT for files on tmpfs 80/37680/2 snapshot
Andreas Dilger [Fri, 21 Feb 2020 00:48:39 +0000 (17:48 -0700)]
LU-11643 libext2fs: don't use O_DIRECT for files on tmpfs

If a filesystem image is on tmpfs, opening it with O_DIRECT for
reading the MMP will fail.  This is unnecessary, since the image
file can't really be open on another node at this point.  If the
open with O_DIRECT fails, retry without it when plausible.

Remove the special-casing of tmpfs from the mmp test cases.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I41f4b31657b06f62f10be8d6e524d303dd3ebbe5
Reviewed-on: https://review.whamcloud.com/37680
Tested-by: jenkins <devops@whamcloud.com>
4 years agoLU-13177 build: add support for SLES15SP1 57/37357/2
Minh Diep [Tue, 28 Jan 2020 22:35:46 +0000 (14:35 -0800)]
LU-13177 build: add support for SLES15SP1

Add SUSE 15SP1 to distro and spec file

Change-Id: Ica12ae0246db4755746ada6647122e8853fc6258
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37357
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
4 years agoLU-11915 deubugfs: add support for xattrs in external inodes 17/35417/2
Artem Blagodarenko [Thu, 4 Jul 2019 10:54:17 +0000 (13:54 +0300)]
LU-11915  deubugfs: add support for xattrs in external inodes

There was "e2fsck: add support for xattrs in external inodes" before
that added xattr in external inode support to utils. But it was
not applied to the last e2fsprogs version for some reasons.

This patch adds external inode output to debugfs that is required
for conf-sanity 115 test.

Change-Id: I3cfca85e2d34b54030d21fafa12be3dbf30e5b5c
Signed-off-by: Artem Blagodarenko <c17828@cray.com>
Reviewed-on: https://review.whamcloud.com/35417
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
4 years agoLU-12403 build: add support for RHEL/CentOS 8 68/35168/3 v1.45.2.wc1
Li Dongyang [Tue, 11 Jun 2019 05:05:03 +0000 (15:05 +1000)]
LU-12403 build: add support for RHEL/CentOS 8

Add RHEL/CentOS 8 to Distro, reuse the RHEL 7 spec.

Change-Id: Ic0fa915d1145ffc04bd5f6f7e3531b892a3d004a
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/35168
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
4 years agoLU-12226 debian: fix debhelper level requirement
Li Dongyang [Fri, 26 Apr 2019 05:23:28 +0000 (15:23 +1000)]
LU-12226 debian: fix debhelper level requirement

Requiring debhelper >= 11 will break the build on
Ubuntu 16.04 LTS, it only has debhelper 9 and 10
from backports.

Change-Id: I40838a4de5ee7a841ba970d4f7531f8fe9dc5ff4
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/34765
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
4 years ago LU-12158 mke2fs: avoid too large stride and stripe_width
Wang Shilong [Tue, 21 May 2019 04:06:39 +0000 (12:06 +0800)]
 LU-12158 mke2fs: avoid too large stride and stripe_width

According to benchmarks numbers, too large stripe and stripe_width
will make preassure with ext4 mballoc allocater and hurts performances
finally.
                    2MB Chunk size                 256K Chunk size
stripe_width,stride     Write(MB/s)    Read(MB/s)   Write(MB/s) Read(MB/s)
512,512                 10,810         10,124       10,492      6,923
1024,1024               10,793         10,064       10,431      6,921
2048,2048               8,047          10,080       6,629       7,381
4096,4096               7,350          10,089       6,505       7,282

Performance number comes from Shuichi Ihara.

This patch try to avoid use too large stride and stripe_width when mkfs.
If users really want large value they could do it by specify mkfs options
or run tune2fs later.

Change-Id: I768f1ecb39837338e08842b21b4fca8b98165d2a
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/34767
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
4 years agoLU-11609 mke2fs: allow 64bit feature without extents
Andreas Dilger [Sat, 3 Nov 2018 09:10:22 +0000 (03:10 -0600)]
LU-11609 mke2fs: allow 64bit feature without extents

The 64bit feature should be allowed without extents to for 32-bit
metadata_csum checksums to be stored in the group descriptor.
Change the extents check to check for more than 2^32 blocks instead
of the 64bit feature flag.  This also avoids warnings later if the
metadata_csum feature is enabled on a filesystem without 64bit.

Consolidate repeated 64bit feature checks into one check.

The fs_blocks_count value is always set when parse_fs_type() is
called, so no need to check if it is zero.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie73ff0ed50cfed5d6a9596260c6b6dc32d3ebbe5
Reviewed-on: https://review.whamcloud.com/33897
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
4 years agoLU-11215 libe2p: add large_xattr as an alias of ea_inode
Li Dongyang [Mon, 6 Aug 2018 01:33:44 +0000 (11:33 +1000)]
LU-11215 libe2p: add large_xattr as an alias of ea_inode

The upstream version of large xattr suppport doesn't
add "large_xattr" as a feature name, but it's still
used by our test scripts.

e2fsprogs commit:6a081f6d2a5cff0f5a077065aab39901d54bfb61

Change-Id: I48d7ac54b2b2ad252c404050bc4c3d9527865107
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/32932
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
4 years agoLU-10638 build: add support for Scientific
Alexander Boyko [Thu, 8 Feb 2018 06:43:40 +0000 (01:43 -0500)]
LU-10638 build: add support for Scientific

Add Scientific to Distro with a reference to RHEL.

Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: I05001ee9233e4cac6b2c6b523a374ffdc243394d
Cray-bug-id: MRP-3882
Reviewed-on: https://review.whamcloud.com/31220
Reviewed-by: Artem Blagodarenko <c17828@cray.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
4 years agoLU-8300 e2fsck: print out FID with dirent inode number
Andreas Dilger [Sat, 18 Jun 2016 10:50:41 +0000 (04:50 -0600)]
LU-8300 e2fsck: print out FID with dirent inode number

When printing out the dirent inode number in e2fsck, also print
out the FID, if available, for reference in the future if needed.

   Entry 'lustre.conf' in /ROOT/etc/yum/protected.d (50132) has
   deleted/unused inode=1964 fid=[0x200000401:0x844:0x0].  Clear? yes

This can be useful if LFSCK is able to rebuild the MDT layout from
the OST object xattrs, but the filename isn't stored on the OST.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Id0ec22c47d83f16c392e93328d2869e7a53ebbe5
Reviewed-on: https://review.whamcloud.com/20866
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Artem Blagodarenko <c17828@cray.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
4 years agoLU-9501 mke2fs: avoid inode number error with large FS
Alexey Lyashkov [Mon, 15 May 2017 14:45:38 +0000 (17:45 +0300)]
LU-9501 mke2fs: avoid inode number error with large FS

Limit inodes count instead of error return, to use all inodes in
the filesystem.

Change-Id: I76ee0a6c11b099b8c17d90b0778e3c0f0cf1f60a
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Reviewed-on: https://review.whamcloud.com/27111
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
4 years agoLU-6722 jbd: double minimum journal size for RHEL7
Fan Yong [Fri, 26 Jun 2015 15:29:59 +0000 (23:29 +0800)]
LU-6722 jbd: double minimum journal size for RHEL7

In RHEL7 (kernel version >= 3.10.0), the maximum journal transaction
size is reduced to half of the RHEL6 case. That may cause Lustre to
complain that the declared transaction credits too large for very
small journal device. This patch increases the minimum journal size
from 4MB to 8MB for RHEL7 case, then counteract the above limitation
about the journal transaction size.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Iec8a2c561416cb7b5acce342c8ebcb845c8d7a19
Reviewed-on: http://review.whamcloud.com/15401
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoLU-5845 build: add support for SUSE_LINUX-12 .spec file
Bob Glossman [Thu, 16 Oct 2014 18:41:07 +0000 (11:41 -0700)]
LU-5845 build: add support for SUSE_LINUX-12 .spec file

Add the SLES 12 .spec file.
For now SLES 12 and SLES 11 can share the same .spec file.

  LU-8390 build: use correct .spec file for SLES 12

  Changes in output from the lsb_release command in SLES 12
  resulted in using the wrong .spec file in builds.
  This patch corrects the problem for old and new versions.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
  Change-Id: I41d47c305eba7d3dd0d313be5ad8192592291fad
  Reviewed-on: http://review.whamcloud.com/21237
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I3b716c09ea8632d2333aaf61b8a6c881ccd18a88
Reviewed-on: http://review.whamcloud.com/12316
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoLU-5307 build: add support for RHEL-7 .spec file
Andreas Dilger [Fri, 18 Jul 2014 20:47:02 +0000 (14:47 -0600)]
LU-5307 build: add support for RHEL-7 .spec file

Add the RHEL 7 .spec file.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I00278b50c3669f56c5297a75b89775fec9476f43

4 years agoLU-1540 e2fsck: add missing symlink NUL terminator
Andreas Dilger [Sat, 14 Jul 2012 02:33:01 +0000 (20:33 -0600)]
LU-1540 e2fsck: add missing symlink NUL terminator

If a long symbolic link target is written into an external block
without a NUL terminator, its length is decided by the inode's size.
Make symlink check add a NUL termination in such cases if needed.

Such faulty symlinks were generated by osd-ldiskfs on the MDS until
Lustre 2.1.3 and Lustre 2.3.  The in-kernel code would handle such
unterminated symlinks correctly, since it used the inode size to
determine the symlink length, but e2fsck would assume the symlink
is broken if there wasn't a trailing NUL.

  LU-2627 e2fsck: check_symlink() SIGSEGV

  Since e2fsck_pass1_check_symlink() calls into check_symlink()
  with pctx == NULL, we should use 'ino' instead of 'pctx->ino'
  in check_symlink().

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
  Change-Id: If9c16f96d0655d5a886ef607f1f47ced6176f8d8

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I4419b30f1adb4a7d273796a936427aa351510213

4 years agoext2fs: check if Lustre filesystem is mounted
Andreas Dilger [Fri, 13 Apr 2012 08:16:24 +0000 (02:16 -0600)]
ext2fs: check if Lustre filesystem is mounted

Add a check to ext2fs_check_mount_point() to loo in /proc/fs/lustre/*
to see if Lustre is mounted, since st_rdev of the mountpoint does not
match st_rdev of the block device itself, which confuses libext2fs.

  LU-6093 ext2fs: don't confuse mke2fs by Lustre zfs mount

  check_if_lustre_mounted() by efb735 will mistakenly report the
  device is mounted when there is a ZFS-based Lustre mount.

  This patch fix it by parsing the real device name from the pool
  name exported in Lustre proc file with "zpool" command.

  It also includes a typo fix in check_if_lustre_mounted() and a
  few other code cleanups.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
  Change-Id: I43dabbcd6fa721c569cd9cc0f4a6de93ab761392
  Reviewed-on: http://review.whamcloud.com/14223
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agodebugfs: dump "fid" and "lma" xattrs on inode stat
Andreas Dilger [Fri, 13 Apr 2012 18:55:45 +0000 (12:55 -0600)]
debugfs: dump "fid" and "lma" xattrs on inode stat

Print out the Lustre "fid" and "lma" object xattr contents,
if present, with debugfs stat to simplify debugging.

  LU-8998 debugfs: handle combined LMA EA and PFID EA

  We need to store the stripe size and stripe count information in
  the OST object's PFID EA for the layout LFSCK to recover the MDT
  object or its (lost or corrupted) LOV EA. On the other hand, for
  PFL file, we also need to store its PFL ID and extent information
  in its OST object's PFID EA.

  Consider performance, we will store the PFID EA inside the inode
  body to avoid extra IO when read/write the PFID EA. Unfortunately,
  the space inside current 256-bytes inode for EA is very limited,
  and above enlarged PFID EA exceeds such limitation. So we have to
  make some hack with the PFID EA and LMA EA combined together. The
  patch makes the debugfs tool to handle such case properly.

Signed-off-by: Fan Yong <fan.yong@intel.com>
  Change-Id: I1380d16d94d6d05272e22fdfff07ada038685669
  Reviewed-on: https://review.whamcloud.com/19436
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotests: add basic tests for dirdata feature
Andreas Dilger [Fri, 18 May 2018 04:52:58 +0000 (14:52 +1000)]
tests: add basic tests for dirdata feature

Signed-off-by: Pravin Shelar <pravin@clusterfs.org>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
4 years agoe2fsck: add support for dirdata feature
Andreas Dilger [Thu, 17 May 2018 03:43:16 +0000 (13:43 +1000)]
e2fsck: add support for dirdata feature

Add support for the INCOMPAT_DIRDATA feature, which allows
storing extra data in the directory entry beyond the name.
This allows the Lustre File IDentifier to be accessed in
an efficient manner, and would be useful for expanding a
filesystem to allow more than 2^32 inodes in the future.

Include this patches:

e2fsck: e2fsck -D does not change dirdata content

Fix dir optimization to preserve dirdata content for dot
and dotdot entries.

Lustre-bug: https://jira.hpdd.intel.com/browse/LU-1774
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Iae190794da75a2080a8e5cc5b95a49e0c894f72f

e2fsprogs: Consider DIRENT_LUFID flag in link_proc().

While adding the new file entry in directory block, link_proc()
calculates minimum record length of the existing directory entry
without considering the dirent data size and which leads to
corruption. Changed the code to use EXT2_DIR_REC_LEN() which will
return correct record length including dirent data size.

Lustre-bug: https://jira.hpdd.intel.com/browse/LU-2462
Signed-off-by: Manisha Salve <msalve@ddn.com>
Change-Id: Ic593c558c47a78183143ec8e99d8385ac94d06f7

libext2fs, e2fsck: don't use ext2_dir_entry_2

Due to endian issues, do not use ext2_dir_entry_2 because it will
have the wrong byte order on directory entries that are swabbed.
Instead, use the standard practice of mask-and-shift to access the
file_type and dirdata flags.

Lustre-bug: https://jira.hpdd.intel.com/browse/LU-4677
Signed-off-by: Pravin Shelar <pravin@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
4 years agotests: verify large xattr inode support
Andreas Dilger [Fri, 13 Apr 2012 08:14:16 +0000 (02:14 -0600)]
tests: verify large xattr inode support

Verify that inodes with large EAs in a secondary inode are working:
* EA inode needs to have EA_INODE_FL set
* EA inode should reference parent inode number+generation

Signed-off-by: Kalpak Shah <kalpak@sun.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agolibext2fs: add a regression test for in-inode xattrs
Andreas Dilger [Fri, 13 Apr 2012 08:01:12 +0000 (02:01 -0600)]
libext2fs: add a regression test for in-inode xattrs

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoe2fsck: clean up xattr checking code
Andreas Dilger [Fri, 13 Apr 2012 08:01:12 +0000 (02:01 -0600)]
e2fsck: clean up xattr checking code

Clean up xattr header/list processing for in-inode xattrs instead
of doing lots of explicit pointer math.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotests: add test cases for inode badness
Andreas Dilger [Fri, 13 Apr 2012 07:23:17 +0000 (01:23 -0600)]
tests: add test cases for inode badness

Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoe2fsck: track errors/badness found for each inode
Andreas Dilger [Fri, 13 Apr 2012 07:13:58 +0000 (01:13 -0600)]
e2fsck: track errors/badness found for each inode

The present e2fsck code checks the inode, per field basis.  It
doesn't take into consideration to total sanity of the inode.
This may cause e2fsck turning a garbage inode into an apparently
sane inode ("It is a vessel of fertilizer, and none may abide
its strength.").

The following patch adds a heuristics to detect the degree of
badness of an inode. icount mechanism is used to keep track of
the badness of every inode.  The badness is increased as various
fields in inode are found to be corrupt.  Badness above a certain
threshold value results in deletion of the inode.  The default
badness threshold value is 7, it can be specified to e2fsck
using "-E inode_badness_threshold=<value>"

This can avoid lengthy pass1b shared block processing, where a
corrupt chunk of the inode table has resulted in a bunch of
garbage inodes suddenly having shared blocks with a lot of good
inodes (or each other).

  LU-11882 e2fsck: zero date is not inode badness

  Lustre FS OST has some precreated objects which have zeroed
  creation time. e2fsck adds badness points for such inodes.
  If OST has many precreated objects, e2fsck spends too much time
  during phase2, because processes each of such inode.

  Let's allow Lustre FS inode has zeroed time field for
  precreated objects.

  Change-Id: I171a0fe741449ca99b29b5af51032a7b4c716344
  Cray-bug-id: LUS-6857
Signed-off-by: Artem Blagodarenko <c17828@cray.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotests: add tests for expanding inode extra size
Andreas Dilger [Fri, 13 Apr 2012 00:05:03 +0000 (18:05 -0600)]
tests: add tests for expanding inode extra size

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoe2fsck: add support for expanding the inode size
Andreas Dilger [Fri, 13 Apr 2012 00:03:37 +0000 (18:03 -0600)]
e2fsck: add support for expanding the inode size

This patch adds a "-E expand_extra_isize" feature which makes sure
that _every_ used inode has i_extra_isize >= s_min_extra_isize if
s_min_extra_isize is set. Else it makes sure that i_extra_isize
of every inode is equal to sizeof(ext2_inode_large) - 128.

This is useful for the case where nanosecond timestamps or 64-bit
inode version fields are required for all inodes in the filesystem.

There is also a fix for test f_itable_collision, the original
E2FSCK_TIME would overflow on a 32bit system when adding with
ctx->time_fudge in EXT4_XTIME_FUTURE, making us increase the
inode badness incorrectly.

  LU-10205 libext2fs: fix buffer overrun in ext2fs_expand_extra_isize

  In ext2fs_expand_extra_isize, we size buffer using 'size' but then
  do the memcpy with the rounded-up size, which can overflow the buffer.

  With MALLOC_CHECK_=2, I see:
  Error in `../e2fsck/e2fsck': free(): invalid pointer: <addr>

  Change-Id: I31be58de12d4d50646c7aa96959de0efc5c279c3
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
  Reviewed-on: https://review.whamcloud.com/29975
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Change-Id: I306ff4f81d8bd6bdf0446c76d6772951043fead4
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotests: add tests for uninitialized bitmaps
Andreas Dilger [Thu, 12 Apr 2012 23:52:44 +0000 (17:52 -0600)]
tests: add tests for uninitialized bitmaps

Various tests for handing uninitialized block and inode bitmaps,
and inodes beyond the in-use high watermark.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotune2fs: warn if the filesystem journal is dirty
Andreas Dilger [Thu, 12 Apr 2012 23:38:13 +0000 (17:38 -0600)]
tune2fs: warn if the filesystem journal is dirty

Running tune2fs on a filesystem with an unrecovered journal can
cause the tune2fs settings to be reverted when the journal is
replayed.  Print a warning if this is detected so that the user
isn't surprised if it happens.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoe2fsck: allow deleting or zeroing shared blocks
Andreas Dilger [Thu, 12 Apr 2012 23:32:53 +0000 (17:32 -0600)]
e2fsck: allow deleting or zeroing shared blocks

E2fsck fixes files that are found to be sharing blocks by cloning
the shared blocks and giving each file a private copy in pass 1D.

Allowing all files claiming the shared blocks to have copies can
inadvertantly bypass access restrictions.  Deleting all the files,
zeroing the cloned blocks, or placing the files in the /lost+found
directory after cloning may be preferable in some secure environments.

The following patches implement config file and command line options
in e2fsck that allow pass 1D behavior to be tuned according to site
policy.  It adds two extended options and config file counterparts.
On the command line:

 -E clone=dup|zero

    Select the block cloning method.  "dup" is old behavior,
    and is the default.  "zero" is a new method that substitutes
    zero-filled blocks for the shared blocks in all the files
    that claim them.

 -E shared=preserve|lost+found|delete

    Select the disposition of files containing shared blocks.
    "preserve" is the old behavior which remains the default.
    "lost+found" causes files to be unlinked after cloning so
    they will be reconnected to /lost+found in pass 3.
    "delete" skips cloning entirely and simply deletes the files.

In the config file:
  [options]
      clone=dup|zero
      shared=preserve|lost+found|delete

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoe2fsck: parse config file before command-line opts
Andreas Dilger [Thu, 12 Apr 2012 23:24:55 +0000 (17:24 -0600)]
e2fsck: parse config file before command-line opts

The patch changes the order that the config file and command line
are parsed so that command line has precedence.  It also parses
the -E option for every occurrence, otherwise the -E option is
not cumulative.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agotests: verify > 65000 subdirectories
Andreas Dilger [Thu, 12 Apr 2012 22:02:12 +0000 (16:02 -0600)]
tests: verify > 65000 subdirectories

Add test case to verify nlink handling of large directories.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoTT-177 build: add .spec file for SLES11 packaging
Andreas Dilger [Fri, 13 Apr 2012 08:23:12 +0000 (02:23 -0600)]
TT-177 build: add .spec file for SLES11 packaging

Include the upstream SLES11 .spec file to ensure the packages we
build match the upstream packages.  Any later patches that change
the packaging should patch the .spec file appropriately.

Add in the SLES-specific patches, excluding the replacement de.po
file, since the original SLES11 de.po file is only against 1.41.4,
and is missing a large number of changes to the translated messages
related to 64-bit format specifiers.

Always skip m_hugefile and t_replay_and_set tests, building rpms in
an ext3 environment will make the tests fail.

  LU-4284 build: add missing Provides line in SLES spec file

  Need to add a line in the SUSE spec file for Provides: ldiskfsprogs.
  This is present in the RHEL spec file and is needed to resolve
  dependencies in lustre server rpms at rpm install time.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
  Change-Id: Ib4821004d27c9a7271ffdbd7403990e586d6c9ca

  LU-9713 build: Require uptodate libcom_err, libss

  Ensure that the libcom_err and libext2fs2 packages installed match the
  other packages built from e2fsprogs so that modifications to those
  libraries (e.g. project quota) are available.

  Test-Parameters: clientdistro=sles12sp2 mdsdistro=sles12sp2 ossdistro=sles12sp2

  Change-Id: Idc22a029a6950cc1ffb9b6e44181d345db3ebbe5
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
  Reviewed-on: https://review.whamcloud.com/27834
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I783d58bd78d7c4c66cc85ec5557ae1aaf64016ba

4 years agobuild: add RHEL6 .spec file for packaging
Andreas Dilger [Fri, 13 Apr 2012 08:19:19 +0000 (02:19 -0600)]
build: add RHEL6 .spec file for packaging

Include the upstream RHEL6 .spec file to ensure the packages we
build match the upstream packages.  Any later patches that change
the packaging should patch the .spec file appropriately.

Change-Id: Ia12d193ff1a9c5a40cee2585a9bc47d5f9f63f4d
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agobuild: update e2fsprogs.spec for distro builds
Andreas Dilger [Thu, 12 Apr 2012 21:39:04 +0000 (15:39 -0600)]
build: update e2fsprogs.spec for distro builds

Add the distro version to the RPM release number, so that it the
RPM names do not conflict.

Allow the RPM built from upstream to replace the split packages
provided by the distros.  At some point in the future it may be
desirable to also split the RPM built by this spec file, but this
bs complicated by the fact that SLES and RHEL have different splits.

Change-Id: Iab8f75a7f7bd9790899a2024d91079d55501ef65
Signed-off-by: Girish Shilamkar <girish.shilamkar@sun.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agofilefrag: Lustre changes to filefrag FIEMAP handling
Andreas Dilger [Thu, 12 Apr 2012 21:31:35 +0000 (15:31 -0600)]
filefrag: Lustre changes to filefrag FIEMAP handling

Add support for multiple-device filesystems by defining a new
fe_device field in the fiemap_extent structure.  This allows
printing the filesystem-relative or linux block device number
associated with each extent of a file.  If a single filesystem
extent is mirrored to multiple block devices, the fe_device
field can be used to disambiguate the multiple copies.

If the "-l" (device-logical) option is given to filefrag, then
all extents for a particular device of a file are returned
before returning extents for the next device.  This makes it
easier to see if extent allocation within a single device is
contiguous, instead of returning all of the blocks of a file
interleaved in file-logical-offset order.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agobuild: update version for Lustre build
Andreas Dilger [Thu, 12 Apr 2012 20:00:07 +0000 (14:00 -0600)]
build: update version for Lustre build

Add Lustre-specific build version to distinguish packages from
upstream packages.

Since e2fsprogs release 1.44.4 the Version in e2fsprogs.spec
is not generated anymore. However contrib/build-rpm still relies
on the Version from the spec, maintain the version in the spec
as well.

e2fsprogs commit: e5f0f3eebef7b483d5cc8b37023d6e0256776d94

Change-Id: I4a31e659ff4d98f9bb00fea731bd1ee59a55fd38
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
4 years agoUpdate release notes, etc., for the 1.45.2 release v1.45.2
Theodore Ts'o [Tue, 28 May 2019 02:10:51 +0000 (22:10 -0400)]
Update release notes, etc., for the 1.45.2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update the binary gmo files
Theodore Ts'o [Tue, 28 May 2019 00:05:54 +0000 (20:05 -0400)]
po: update the binary gmo files

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agomke2fs: accept the english yes character to the proceed question
Theodore Ts'o [Mon, 27 May 2019 23:36:15 +0000 (19:36 -0400)]
mke2fs: accept the english yes character to the proceed question

In some cases if the translation file is missing some translations,
mke2fs can end up printing an English message, e.g.:

% LANG=it_IT.UTF-8 ./mke2fs /tmp/foo.img 8M
mke2fs 1.45.1 (12-May-2019)
/tmp/foo.img contiene un file system ext4
created on Mon May 27 19:35:48 2019
Proceed anyway? (y,N)

However, if there is a translation for string to match with "yY"
(e.g., to "sS" for Italian), then 'y' won't work.  Fix this by falling
back to the english 'yY' characters.

Addresses-Debian-Bug: #907034
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update ms.po (from translationproject.org)
Sharuzzaman Ahmat Raslan [Mon, 27 May 2019 04:24:01 +0000 (00:24 -0400)]
po: update ms.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update es.po (from translationproject.org)
Antonio Ceballos [Mon, 27 May 2019 04:24:01 +0000 (00:24 -0400)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: handle verity files in scan_extent_node()
Eric Biggers [Thu, 23 May 2019 15:30:33 +0000 (08:30 -0700)]
e2fsck: handle verity files in scan_extent_node()

Don't report PR_1_EXTENT_END_OUT_OF_BOUNDS on verity files during
scan_extent_node(), since they will have blocks stored past i_size.

This was missed during the earlier fix because this check only triggers
if the inode has enough extents to need at least one extent index node.

This bug is causing one of the fs-verity xfstests to fail with the
reworked fs-verity patchset.

Fixes: 3baafde6a8ae ("e2fsck: allow verity files to have initialized blocks past i_size")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoconfigure: fix test where cron is not installed on a non-systemd system
Theodore Ts'o [Wed, 22 May 2019 17:03:38 +0000 (13:03 -0400)]
configure: fix test where cron is not installed on a non-systemd system

Reported-by: thomas@linuxfromscratch.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: add new Portuguese translation from the Translation Project
Theodore Ts'o [Wed, 22 May 2019 16:33:55 +0000 (12:33 -0400)]
po: add new Portuguese translation from the Translation Project

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Wed, 22 May 2019 16:31:37 +0000 (12:31 -0400)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agodebian: update changelog for maintenance releases
Theodore Ts'o [Wed, 22 May 2019 16:31:04 +0000 (12:31 -0400)]
debian: update changelog for maintenance releases

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub_all: fix missing getopts argument which broke e2scrub_all -C
Theodore Ts'o [Tue, 21 May 2019 00:34:59 +0000 (20:34 -0400)]
e2scrub_all: fix missing getopts argument which broke e2scrub_all -C

Addresses-Debian-Bug: #929287

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub: fix grammar nit: "a LVM" -> "an LVM"
Theodore Ts'o [Mon, 20 May 2019 14:56:51 +0000 (10:56 -0400)]
e2scrub: fix grammar nit: "a LVM" -> "an LVM"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Sun, 19 May 2019 03:32:30 +0000 (23:32 -0400)]
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Sun, 19 May 2019 03:32:29 +0000 (23:32 -0400)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Sun, 19 May 2019 03:32:29 +0000 (23:32 -0400)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub_all: avoid scrubbing all devices when there is nothing to scrub
Theodore Ts'o [Sun, 19 May 2019 03:04:49 +0000 (23:04 -0400)]
e2scrub_all: avoid scrubbing all devices when there is nothing to scrub

Running lsblk when there are no valid block devicse results in
generating all block devices as the list of devices to scrub; this
results in a lot of e2scrub_all failures.

Addresses-Debian-Bug: #929186

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub: stop cron spam if lvm2 is not installed.
Theodore Ts'o [Thu, 16 May 2019 18:56:37 +0000 (14:56 -0400)]
e2scrub: stop cron spam if lvm2 is not installed.

Addresses-Debian-Bug: #928977

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoUpdate release notes, etc., for the 1.45.1 release v1.45.1
Theodore Ts'o [Mon, 13 May 2019 01:10:29 +0000 (21:10 -0400)]
Update release notes, etc., for the 1.45.1 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: remove an potentially ambiguous dangling else clause
Theodore Ts'o [Fri, 10 May 2019 23:21:03 +0000 (19:21 -0400)]
e2fsck: remove an potentially ambiguous dangling else clause

This doesn't actually fix a bug or change behavior, but it removes a
clang warning.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: hide struct ext2fs_hashmap as an internal implementation detail
Theodore Ts'o [Fri, 10 May 2019 23:00:13 +0000 (19:00 -0400)]
libext2fs: hide struct ext2fs_hashmap as an internal implementation detail

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agomke2fs: fix memory leak when parsing encoding flags
Theodore Ts'o [Fri, 10 May 2019 18:38:24 +0000 (14:38 -0400)]
mke2fs: fix memory leak when parsing encoding flags

Also fix extended-options usage string.

Addresses-Coverity-Bug: 1444984
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: fix printf format / argument mismatches
Theodore Ts'o [Fri, 10 May 2019 18:26:27 +0000 (14:26 -0400)]
e2fsck: fix printf format / argument mismatches

Fixes-Coverity-Bug: 1444982
Fixes-Coverity-Bug: 1444983
Fixes-Coverity-Bug: 1444985
Fixes-Coverity-Bug: 1444986
Fixes-Coverity-Bug: 1444987
Fixes-Coverity-Bug: 1444988
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: add missing check for utf8lookup()'s return value
Theodore Ts'o [Fri, 10 May 2019 18:18:12 +0000 (14:18 -0400)]
libext2fs: add missing check for utf8lookup()'s return value

Fixes-Coverity-Bug: 1442630
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
4 years agoFix parallel install issue in scrub subdir
Michael Haubenwallner [Tue, 7 May 2019 12:49:25 +0000 (14:49 +0200)]
Fix parallel install issue in scrub subdir

In scrub/Makefile the various 'install-*' targets do not explicitly
depend on their corresponding 'installdirs-*' target, so they get run
in parallel.

Addresses-Gentoo-Bug: #680030

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: fix XML validity problem with the problem log
Theodore Ts'o [Fri, 10 May 2019 17:20:59 +0000 (13:20 -0400)]
e2fsck: fix XML validity problem with the problem log

Also fix a gcc warning.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoUpdate release notes, etc., for the 1.45.1-rc1 release v1.45.1-rc1
Theodore Ts'o [Mon, 6 May 2019 23:12:58 +0000 (19:12 -0400)]
Update release notes, etc., for the 1.45.1-rc1 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: add support for saving the problem code log
Theodore Ts'o [Mon, 6 May 2019 05:10:53 +0000 (01:10 -0400)]
e2fsck: add support for saving the problem code log

Add the ability to save a log of problems found by e2fsck in a log
file that can be specified via /etc/e2fsck.conf.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub: make the e2scrub service files require CAP_SYS_ADMIN and CAP_SYS_RAWIO
Theodore Ts'o [Mon, 6 May 2019 02:26:04 +0000 (22:26 -0400)]
e2scrub: make the e2scrub service files require CAP_SYS_ADMIN and CAP_SYS_RAWIO

Addresses-Debian-Bug: #926138

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2scrub: tag the *.e2scrub LV's with UDISK_IGNORE in udev
Theodore Ts'o [Mon, 6 May 2019 02:00:16 +0000 (22:00 -0400)]
e2scrub: tag the *.e2scrub LV's with UDISK_IGNORE in udev

Force the *.e2scrub LV's to be ignored by udisk.

Addresses-Debian-Bug: #926112

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agomke2fs: fix check for absurdly large devices
Andreas Dilger [Sun, 5 May 2019 22:33:46 +0000 (18:33 -0400)]
mke2fs: fix check for absurdly large devices

The check in mke2fs is intended to be for the number of blocks in the
filesystem exceeding the maximum number of addressable blocks in 2^32
bitmaps, which is (2^32 * 8 bits/byte * blocksize) = 2^47 blocks,
or 2^59 bytes = 512PiB for the common 4KiB blocksize.

However, s_log_blocksize holds log2(blocksize_in_kb), so the current
calculation is a factor of 2^10 too small.  This caused mke2fs to fail
while trying to format a 900TB filesystem.

Fixes: 101ef2e93c25 ("mke2fs: Avoid crashes / infinite loops for absurdly large devices")
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoe2fsck: check and fix tails of all bitmap blocks
Theodore Ts'o [Sun, 5 May 2019 20:43:33 +0000 (16:43 -0400)]
e2fsck: check and fix tails of all bitmap blocks

Currently, e2fsck effectively checks only tail of the last inode and
block bitmap in the filesystem. Thus if some previous bitmap has unset
bits it goes unnoticed.  Mostly these tail bits in the bitmap are
ignored; however, if blocks_per_group are smaller than 8*blocksize,
the multi-block allocator in the kernel can get confused when the tail
bits are unset and return bogus free extent.

Add support to libext2fs to check these bitmap tails when loading
bitmaps (as that's about the only place which has access to the bitmap
tail bits) and make e2fsck use this functionality to detect buggy bitmap
tails and fix them (by rewriting the bitmaps).

Reported-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
4 years agodebian: update libext2fs2.symbols file
Theodore Ts'o [Sun, 5 May 2019 02:51:43 +0000 (22:51 -0400)]
debian: update libext2fs2.symbols file

Update to reflect changes to avoid leaking utf8 and nls symbols into
the namespace.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: move struct ext2fs_nls_table to the private ext2fsP.h header
Theodore Ts'o [Fri, 3 May 2019 20:42:36 +0000 (16:42 -0400)]
libext2fs: move struct ext2fs_nls_table to the private ext2fsP.h header

Callers of libext2fs don't need to use this structure, and this gives
us the ability to change it later on without worrying about
changing public ABI's.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoRename the feature "fname_encoding" to be "casefold".
Theodore Ts'o [Fri, 3 May 2019 17:16:29 +0000 (13:16 -0400)]
Rename the feature "fname_encoding" to be "casefold".

Also change mke2fs so that the encoding and encoding flags are
specified in mke2fs.conf in the fs_types and defaults stanzas instead
of the options stanza.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agodebugfs: teach set_super_value how to set the s_encoding field
Theodore Ts'o [Thu, 2 May 2019 17:19:01 +0000 (13:19 -0400)]
debugfs: teach set_super_value how to set the s_encoding field

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibe2p: print the filename character encoding in list_super[2]
Theodore Ts'o [Thu, 2 May 2019 15:48:45 +0000 (11:48 -0400)]
libe2p: print the filename character encoding in list_super[2]

Also clean up some gcc -Wall warnings while we're at it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: remove utf8_* namespace contamination
Theodore Ts'o [Mon, 29 Apr 2019 13:15:48 +0000 (09:15 -0400)]
libext2fs: remove utf8_* namespace contamination

Merge nls_utf8-norm.c and nls_utf8.c.  This also allows us to comment
out functions which we don't actually need for e2fsprogs.

Also fix some gcc -Wall complaints, including one which would have
caused utf8_casefold() to misbehave (this was fixed in the kernel, but
not carried back to e2fsprogs).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: remove nls_* namespace contamination
Theodore Ts'o [Mon, 29 Apr 2019 02:04:10 +0000 (22:04 -0400)]
libext2fs: remove nls_* namespace contamination

Also remove nls.h, and avoid declaring static functions and variables
in a header file, which is wasteful of space.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: remove unused variable 'old_flags'
Eric Biggers [Mon, 29 Apr 2019 00:37:45 +0000 (20:37 -0400)]
libext2fs: remove unused variable 'old_flags'

In ext2fs_write_inode2(), the 'old_flags' variable is never used.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agodebugfs: remove unused variable 'tmp_inode'
Eric Biggers [Mon, 29 Apr 2019 00:37:21 +0000 (20:37 -0400)]
debugfs: remove unused variable 'tmp_inode'

In parse_inode_csum(), the outer 'tmp_inode' variable is never used.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agolibext2fs: remove unused variable 'buff'
Eric Biggers [Mon, 22 Apr 2019 21:08:43 +0000 (14:08 -0700)]
libext2fs: remove unused variable 'buff'

In ext2fs_dirhash2(), the outer 'buff' variable is never used.

Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agodebugfs: fix encoding handling in dx_hash command
Eric Biggers [Mon, 29 Apr 2019 00:35:21 +0000 (20:35 -0400)]
debugfs: fix encoding handling in dx_hash command

Fix the following bugs:

1. 'encoding' and 'hash_flags' are not initialized, causing a segfault.

2. 'hash_flags' incorrectly uses a __bitwise type.

3. The optstring doesn't contain "c" or "e", so the -c and -e options
   aren't recognized.

4. The code that handles the -e option always returns.

Fixes: ef733f1a97ec ("debugfs: support encoding when printing the file hash")
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agodebugfs: avoid ambiguity when printing filenames
Eric Biggers [Sun, 28 Apr 2019 23:42:41 +0000 (19:42 -0400)]
debugfs: avoid ambiguity when printing filenames

The way debugfs escapes filenames is ambiguous because a sequence like
M-A can mean either the byte 'A' + 128 == 0xc1 or the three bytes
{'M', '-', 'A'}.  Similarly, ^A can mean either the byte
'A' ^ 0x40 == 0x01 or the two bytes {'^', 'A'}.

Fix this and simplify the code by switching to a simpler strategy where
all bytes < 32, all bytes >= 127, and backslash are encoded with C-style
hex escape sequences.  E.g., the byte 0xc1 will now be encoded as \xc1
rather than M-A as it was before, while a filename consisting of the
three bytes {'M', '-', 'A'} will continue to be shown as M-A.

I want to fix this mainly because I want to use debugfs to retrieve raw
encrypted filenames for ciphertext verification tests.  But this doesn't
work if the returned filenames are ambiguous.

Fixes: 68a1de3df340 ("debugfs: pretty print encrypted filenames in the ls command")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext4.5.in: document design changes on the casefold attribute
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 20:53:08 +0000 (16:53 -0400)]
ext4.5.in: document design changes on the casefold attribute

Document the fact that the encoding support is only used by directories
with the +F attribute.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: drop ASCII NLS support
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 20:52:12 +0000 (16:52 -0400)]
ext2fs: drop ASCII NLS support

As agreed on the kernel side, ext4 will only support utf8 for now, and
not plain ASCII, so we don't need this anymore.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: drop Unicode normalization support
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 20:48:01 +0000 (16:48 -0400)]
ext2fs: drop Unicode normalization support

No longer necessary after +F design change.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: don't normalize names on -F directories
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 20:45:41 +0000 (16:45 -0400)]
ext2fs: don't normalize names on -F directories

As agreed on the new design, even if fname_encoding is enabled,
directories entries who aren't owned by a +F directory will not be
normalized.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: nls: Update to unicode 12.1.0
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 20:33:36 +0000 (16:33 -0400)]
ext2fs: nls: Update to unicode 12.1.0

Since we didn't release a kernel version that supports version 11.0.0,
it should be safe to reuse the sb entry for version 12.1.0.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: merge sparse fixes for unicode normalization
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 19:12:12 +0000 (15:12 -0400)]
ext2fs: merge sparse fixes for unicode normalization

The sparse script complained about the following issues in the kernel
version of this script.  This patch port the fixes to the userspace
version.

sparse warnings: (new ones prefixed by >>)

>> fs/unicode/utf8-norm.c:41:24: sparse: non-ANSI function declaration
   of function 'utf8version_latest'

vim +/utf8version_latest +41 fs/unicode/utf8-norm.c

  40
> 41 int utf8version_latest()
  42 {
  43 return utf8vers;
  44 }
  45 EXPORT_SYMBOL(utf8version_latest);
  46

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: fix potential null dereference in utf8nlookup
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 19:10:21 +0000 (15:10 -0400)]
ext2fs: fix potential null dereference in utf8nlookup

Delay the access of data->offset until after the null check.  This was
reported by 0-day on the kernel version of the script.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: convert unicode normalization from NFKD -> NFD
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 19:08:39 +0000 (15:08 -0400)]
ext2fs: convert unicode normalization from NFKD -> NFD

Following the kernel transition, convert the normalization format from
NFKD to NFD.  This also regenerates the utf8data.h database.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 years agoext2fs: always attempt to load nls table when loading the filesystem
Gabriel Krisman Bertazi [Sun, 28 Apr 2019 19:06:27 +0000 (15:06 -0400)]
ext2fs: always attempt to load nls table when loading the filesystem

fs->encoding is exposed by the library, so we need to at least try to
load it when populating ext2_filsys.  Nevertheless, failing to do so
shouldn't be a fatal error, unless the user really needs that
information.  Thus, we ignore this failure during open/initialization
and let the user who needs it validate that field before trying to use
it.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>