Whamcloud - gitweb
tools/e2fsprogs.git
5 months agoe2fsck: kickoff mutex lock for block found map
Wang Shilong [Wed, 11 Mar 2020 02:12:18 +0000 (10:12 +0800)]
e2fsck: kickoff mutex lock for block found map

Now @block_found_map is no longer shared by multiple threads,
and @block_dup_map need be checked again after threads finish.

E2fsprogs-commit: 17df3e9f85594eca5515630753542ab5a5c92ee1

Change-Id: I4fb9ae84b70b7ee7d7ce2c0f7a8876ab89c31b5c
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoLU-16972 e2fsck: fix merging ea_inode_refs
Li Dongyang [Wed, 26 Jul 2023 05:10:11 +0000 (15:10 +1000)]
LU-16972 e2fsck: fix merging ea_inode_refs

ea_inode_refs is used to track refs to ea inodes,
which has nothing to do with blocks.

Change-Id: Icd965a8e3a92edc51754c132b55044af9abbb9e4
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/51763
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
5 months agoe2fsck: merge EA blocks properly
Wang Shilong [Thu, 12 Mar 2020 08:05:51 +0000 (16:05 +0800)]
e2fsck: merge EA blocks properly

EA blocks might be shared, merge them carefully.

E2fsprogs-commit: b9c38a69ff1af2e0c2b9ddce96de965ce62b0de6

Change-Id: Ib01b7cf9c32f7e119bfd00972488b731b13f1ed9
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: split and merge invalid bitmaps
Wang Shilong [Sat, 14 Dec 2019 05:12:36 +0000 (13:12 +0800)]
e2fsck: split and merge invalid bitmaps

Invalid bitmaps are splitted per thread, and we
should merge them after thread finish.

E2fsprogs-commit: e3e15f5c8f72f95d65d602929f59c1c78e72c5a0

Change-Id: I004f595c107adf390f3b16b90cb4b6aa3650f9de
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: move some fixes out of parallel pthreads
Wang Shilong [Sat, 7 Mar 2020 14:00:45 +0000 (22:00 +0800)]
e2fsck: move some fixes out of parallel pthreads

We could only use @found_map_block to find free blocks
after we have collectd all used blocks, so something like
handle_fs_bad_blocks(), ext2fs_create_resize_inode(),
e2fsck_pass1_dupblocks() really should be handled after
all threads has been finished.

E2fsprogs-commit: 6b1d459bf6018eea7ff0a0ae6b555276718dcda3

Change-Id: Ibdbaed3d218623daa0baec31837037d773799262
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: serialize fix operations
Wang Shilong [Fri, 6 Mar 2020 08:46:47 +0000 (16:46 +0800)]
e2fsck: serialize fix operations

Allow different threads to fix at the same time could
be dangerous and error-prone now, and most of time
parallel scanning and checking is important.

So this patch adds a mutex to serialize
fix operations during pass1.

And the good benefit of this, we don't need block
allocations and free, superblock updates protection
any more, since only fix operations during pass1
could touch them.

E2fsprogs-commit: 5485120b668c952b6e83f24a1e1a74eaa7bf362e

Change-Id: Iedb64545240cc9325dc0c4ce737a970b27f4f3f6
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge quota context after threads finish
Wang Shilong [Fri, 6 Mar 2020 15:08:07 +0000 (23:08 +0800)]
e2fsck: merge quota context after threads finish

Every threads calculate its own quota accounting,
merge them after threads finish.

E2fsprogs-commit: a0af18577fbb960eb20695afbb4af4e23b864909

Change-Id: If9f0e17e560715ed55183f85c443f21ebbce7d40
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge context flags properly
Wang Shilong [Mon, 24 Feb 2020 05:08:58 +0000 (13:08 +0800)]
e2fsck: merge context flags properly

e2fsck might restart after pass1, so we should keep
flags if possible, this patch try to fix f_illitable_flexbg failure

E2fsprogs-commit: c36fa1b28bd4171f53ab4f89a90f6b3b8bf80fd2

Change-Id: I6dda1520a2ff6255d244461af75d7609f47ba92b
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge dirs_to_hash when threads finish
Wang Shilong [Mon, 24 Feb 2020 04:44:06 +0000 (12:44 +0800)]
e2fsck: merge dirs_to_hash when threads finish

@dirs_to_hash list need be merged after threads finish,
test covered by t_dangerous.

E2fsprogs-commit: e2db6c19943065909c11af3b03c2904c35e5e4f8

Change-Id: I99b44c40afa22ce8e4530c874b077493cf969e03
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge dx_dir_info after threads finish
Wang Shilong [Fri, 6 Dec 2019 15:37:53 +0000 (23:37 +0800)]
e2fsck: merge dx_dir_info after threads finish

Merge properly.

E2fsprogs-commit: 45519b8167a00979e86d5a5aa95d0bfb07f72520

Change-Id: Ifaed7a0022b716c42df908327c41aaaaa39aa365
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge fs flags when threads finish
Li Xi [Sun, 8 Sep 2019 08:15:35 +0000 (16:15 +0800)]
e2fsck: merge fs flags when threads finish

merge fs flags properly.

E2fsprogs-commit: d4c0519725d59c9380acc828d24bc070c5bc2c03

Change-Id: I80c773bebc0e321bf2fe3b436c3f0e601b1f1b79
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge counts after threads finish
Wang Shilong [Tue, 22 Sep 2020 13:14:39 +0000 (21:14 +0800)]
e2fsck: merge counts after threads finish

Merge counts properly.

E2fsprogs-commit: 057060ccabf9b5b47afe435d90a1f7f68c03a231

Change-Id: Ieace889f0d1a20a1990424113b0e8fc81f945266
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: add debug codes for multiple threads
Li Xi [Thu, 5 Sep 2019 11:40:36 +0000 (19:40 +0800)]
e2fsck: add debug codes for multiple threads

These debug codes are added to run the multiple pass1 check
thread one by one in order. If all the codes are correct,
fsck of multiple threads should have exactly the same outcome
with single thread.

E2fsprogs-commit: a8b483a1e7987a6dddc32bc82db06f649d245630

Change-Id: I41b0493a0cd830b76434ff0f86a87c98d8d3ad22
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge dblist after thread finishes
Li Xi [Thu, 5 Sep 2019 08:30:40 +0000 (16:30 +0800)]
e2fsck: merge dblist after thread finishes

Merge dblist properly.

E2fsprogs-commit: f3c2256490297201c63139ba0fea5c6b09bca3cf

Change-Id: Ifd907035ed9762c446c688ccc5af3f3fcaa52d24
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge icounts after thread finishes
Li Xi [Wed, 4 Sep 2019 10:47:14 +0000 (18:47 +0800)]
e2fsck: merge icounts after thread finishes

Merge inode_count and inode_link_info properly after
threads finish.

E2fsprogs-commit: bb78742b5e2e95c3e7e9a76755144fdf8ec12285

Change-Id: If40930a87595010963fd59a54709a4d2b27d223b
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge badblocks after thread finishes
Wang Shilong [Tue, 22 Sep 2020 10:00:39 +0000 (18:00 +0800)]
e2fsck: merge badblocks after thread finishes

Badblocks should be merged properly after threads finish.

E2fsprogs-commit: f39197f53ef5d90cd6952d7e75f2d2e3a02bf7ef

Change-Id: Ieb9a96a5e4438270ba6e939155e2666bb53177e4
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: rbtree bitmap for dir
Wang Shilong [Mon, 21 Sep 2020 11:02:33 +0000 (19:02 +0800)]
e2fsck: rbtree bitmap for dir

Only rbtree support merge operation now, use it for bitmaps.

E2fsprogs-commit: 9bab3284e30752bccc36be3e07b9ca4dfd218041

Change-Id: I42aeb009ece78a4baf4369aff3355fc9df51089a
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge dir_info after thread finishes
Li Xi [Mon, 2 Sep 2019 08:14:38 +0000 (16:14 +0800)]
e2fsck: merge dir_info after thread finishes

dir_info need be merged after thread finish.

E2fsprogs-commit: fdbf5e226cf931a5713414001b95e4697997a464

Change-Id: I7e33c0035ec8c6bfa7c13d759e3edb468634eae3
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: optimize the inserting of dir_info_db
Li Xi [Fri, 30 Aug 2019 09:56:10 +0000 (17:56 +0800)]
e2fsck: optimize the inserting of dir_info_db

Binary search is now used when inserting an dir info to the array.
Memmove is now used when moving array. Both of them improves
the performance of inserting.

This patch is also a prepartion for the merging of two dir db
arrays.

E2fsprogs-commit: 13d3c76475d050941d244c85cbb9256ffd980f88

Change-Id: I69041084dbd7e36eefa44744c3fb3737af8e906e
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: do not change global variables
Li Xi [Fri, 30 Aug 2019 04:20:11 +0000 (12:20 +0800)]
e2fsck: do not change global variables

Global variables used in pass1 check are changed to local variables
in this patch. This will avoid conflict between threads.

E2fsprogs-commit: 5a1b22da5ca3e90728cee1dbe6bc1920b245dded

Change-Id: Ifc682874801af15e8e13764832ca569b7da4ac57
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: merge bitmaps after thread completes
Wang Shilong [Wed, 23 Sep 2020 03:17:29 +0000 (11:17 +0800)]
e2fsck: merge bitmaps after thread completes

A new method merge_bmap has been added to bitmap operations. But
only red-black bitmap has that operation now.

E2fsprogs-commit: ecf85fb474fb7537f14bddd8f85d8372b808d5e9

Change-Id: Id5c387dd813d633adff3afb9208213086c33b6d2
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: print thread log properly
Li Xi [Mon, 26 Aug 2019 14:34:06 +0000 (22:34 +0800)]
e2fsck: print thread log properly

When multi-thread fsck is enabled, logs printed from multiple
threads could overlap with each other. The overlap sometimes
makes the logs unreadable because log_out() is used multiple times
for a single line.

This patch adds leading [Thread XXX] to each logs if multi-thread
is enabed by -m option.

This patch also adds message to show the group ranges and inode
numbers for each thread, which is useful for debuging multi-thread
check.

E2fsprogs-commit: 5b071ed80deca2cdc87585a673076529dd47ca6e

Change-Id: I4bd08bc48813a399ab3a79130ff159b12d22f3a0
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: split groups to different threads
Li Xi [Thu, 22 Aug 2019 07:35:12 +0000 (15:35 +0800)]
e2fsck: split groups to different threads

The start/end groups of a thread is calculated according to the
thread number. But still, only one thread is used to check.

E2fsprogs-commit: 562df7468d97042689896cff4b48c6cebc3b8508

Change-Id: I3175b4e6f0423ecd69ed55afea45f1c5919f5c79
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: add start/end group for thread
Li Xi [Wed, 21 Aug 2019 13:58:31 +0000 (21:58 +0800)]
e2fsck: add start/end group for thread

When multi-threads are used for check, each thread needs to jump
to different group in pass1 check. This patch adds the group
jumping support. But still, only one thread is used to check.

E2fsprogs-commit: f64ff7f53c6fb22c7e4bebe86749b1be31439424

Change-Id: I904bedcbd02bca591665943cff5f2d7a6fa50fbe
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: configure one pfsck thread
Li Xi [Thu, 15 Aug 2019 08:33:19 +0000 (16:33 +0800)]
e2fsck: configure one pfsck thread

This patch creates only one thread to do pass1 check if pthreads are
enabled. The same codes can be used to create multiple threads, but
other functions need to be modified to get ready for that.

E2fsprogs-commit: b2a9a40831dfbb6dacf8bbc819acac2c25ab6980

Change-Id: I3df998a8ecc00d2dc5e959f5a9991a6b65182572
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: create logs for mult-threads
Li Xi [Tue, 13 Aug 2019 03:55:27 +0000 (11:55 +0800)]
e2fsck: create logs for mult-threads

When multi-threads are used, different logs should be created
for different threads. Each thread has log files with suffix
of ".$THREAD_INDEX".

And this patch adds f_multithread_logfile test case.

E2fsprogs-commit: 2643de7d00dc8da9f5be79fab768fca7a27f3745

Change-Id: I86982866b9e8e2d2cc5ac2ec9ac44a3b802c21e0
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: open io-channel when copying fs
Li Xi [Sat, 10 Aug 2019 07:59:09 +0000 (15:59 +0800)]
e2fsck: open io-channel when copying fs

This patch also add writethrough flag to the thread io-channel.
When multiple threads write the same disk, we don't want the
data being saved in memory cache. This will be useful in the
future, but even without that flag, the tests can be passed too.

This patch also cleanup the io channel cache of the global
context. Otherwise, after pass1 step, the next steps would use
old data saved in the cache. And the cached data might have
already been overwritten in pass1.

E2fsprogs-commit: f15100003400e5fc01b34c25a7a4b61f5ed76148

Change-Id: I7fcf4038b6cb4eb52808b9a5bafdf909ca2c0c8e
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: copy badblocks when copying fs
Wang Shilong [Wed, 9 Sep 2020 07:07:10 +0000 (15:07 +0800)]
e2fsck: copy badblocks when copying fs

This patch copies badblocks when the copying fs.

E2fsprogs-commit: 8095b716e15bb15a47925ae02cb1c06e91fdb651

Change-Id: Ibf5718ad5851a9ccd853a2a1f928bce447aa5de9
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: copy bitmaps when copying context
Li Xi [Wed, 7 Aug 2019 08:54:41 +0000 (16:54 +0800)]
e2fsck: copy bitmaps when copying context

This patch copies bitmap when the copying context. In the
multi-thread fsck, each thread use different bitmap that copied
from the glboal bitmap. And Bitmaps from multiple threads will
be merged into a global one after the pass1 finishes.

E2fsprogs-commit: 4d47d0e84388bdf2242e09f9ba592ea778c1ba8e

Change-Id: I6a5a2b49b845215a7a735a828709396586520536
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: add assert when copying context
Li Xi [Wed, 7 Aug 2019 07:34:00 +0000 (15:34 +0800)]
e2fsck: add assert when copying context

Adding the assert would simplify the copying of context.

E2fsprogs-commit: 464abd60f5b68716d8ac5063d90562f9ecd2b004

Change-Id: I8276c2e90f40b08dea28b157e04df3c0f7099211
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: clear icache when using multi-thread fsck
Wang Shilong [Thu, 17 Sep 2020 02:58:56 +0000 (10:58 +0800)]
e2fsck: clear icache when using multi-thread fsck

icache of fs will be rebuilt when needed, so after copying
fs, icache can be inited to NULL.

E2fsprogs-commit: 5d4f09fa148e41b4e0ea01fc364de5bbedf02ecf

Change-Id: I21c58b3f126fd85008d6c732da71b298b2a8b4ff
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: copy fs when using multi-thread fsck
Li Xi [Tue, 6 Aug 2019 03:19:15 +0000 (11:19 +0800)]
e2fsck: copy fs when using multi-thread fsck

This patch only copy the fs to a new one when -m is enabled.
It doesn't actually start any thread. When pass1 test finishes,
the new fs is copied back to the original context.

This patch handles the fs fields in dblist, inode_map and block_map
properly.

E2fsprogs-commit: d88f9ae76882fc1210158ca3558c0bbad6676a79

Change-Id: Iab763de64e63366bc413d954dd7c8a8af45cb6a2
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: copy context when using multi-thread fsck
Li Xi [Mon, 5 Aug 2019 04:01:17 +0000 (12:01 +0800)]
e2fsck: copy context when using multi-thread fsck

This patch only copy the context to a new one when -m is enabled.
It doesn't actually start any thread. When pass1 test finishes,
the new context is copied back to the original context.

Since the signal handler only changes the original context, so
add global_ctx in "struct e2fsck_struct" and use that to check
whether there is any signal of canceling.

This patch handles the long jump properly so that all the existing
tests can be passed even the context has been copied. Otherwise,
test f_expisize_ea_del would fail when aborting.

E2fsprogs-commit: 05a637a9e68d3f7e15323deeab00981d4b7df7e8

Change-Id: I4994e62bdf27c385b02e55de82a9dafcc6a12139
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoe2fsck: add -m option for multithread
Li Xi [Sun, 4 Aug 2019 15:28:59 +0000 (23:28 +0800)]
e2fsck: add -m option for multithread

-m option is added but no actual functionality is added. This
patch only adds the logic that when -m is specified, one of
-p/-y/-n options should be specified. And when -m is specified,
-C shouldn't be specified and the completion progress report won't
be triggered by sending SIGUSR1/SIGUSR2 signals. This simplifies
the implementation of multi-thread fsck in the future.

Completion progress support with multi-thread fsck will be added
back after multi-thread fsck implementation is finished. Right
now, disable it to simplify the implementation of multi-thread fsck.

E2fsprogs-commit: 842ae5f528f9797e4b2c739daa76884e4349e8f3

Change-Id: I428f4f3b10974b769100bf00169bdd7d8cf86deb
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoLU-17310 tests: make m_assume_storage_prezeroed more robust
Andreas Dilger [Thu, 23 Nov 2023 02:47:38 +0000 (19:47 -0700)]
LU-17310 tests: make m_assume_storage_prezeroed more robust

Don't assume that mke2fs is going to zero out an exact number
of blocks when run with/without "-E assume_storage_prezeroed",
since this depends on a number of different options that are
not specified in the test script.

Instead, check that the number of blocks zeroed in the image is
a small fraction (1/15th) of the number of blocks zeroed when
"-E assume_storage_prezeroed" is not given, which makes it more
robust when running in different environments.  This varies from
1/16 in the original test to 1/91 in my local test environment.

Avoid "losetup --sector-size 4096", use "mke2fs -b 4096" instead.
Clean up the loop device before checking "stat" so that all
blocks are flushed to the backing storage before calling sync.
Only one loop device and test file is needed for the test.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Change-Id: I98fc3f5334cb8e2dd754c5d4994f2ca582300c13
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/53217
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
5 months agoLU-14432 configure.ac: fix AC_PREREQ
Li Dongyang [Sun, 14 Feb 2021 23:30:11 +0000 (10:30 +1100)]
LU-14432 configure.ac: fix AC_PREREQ

AS_HELP_STRING was introduced in autoconf 2.58
requiring autoconf 2.69 is not necessary and it breaks
several builds in our Jenkins.

Change required autoconf to 2.59 just to be safe.

Change-Id: I30af873879866858d32b715ac4ce78d095e10f7d
Fixes: 8c9e2921 ("configure.ac: convert all help strings to use AS_HELP_STRING")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/41665
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
5 months agoUpdate release notes, etc., for the 1.47.2 release
Theodore Ts'o [Wed, 1 Jan 2025 06:24:42 +0000 (01:24 -0500)]
Update release notes, etc., for the 1.47.2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agoconfig: update config.{guess,sub}
Theodore Ts'o [Wed, 1 Jan 2025 06:21:15 +0000 (01:21 -0500)]
config: update config.{guess,sub}

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update the binary gmo files
Theodore Ts'o [Wed, 1 Jan 2025 06:09:43 +0000 (01:09 -0500)]
po: update the binary gmo files

Also relax the msgfmt checking to avoid using --check-format, since
e2fsck's problem string's %-interpolation allows the ordering of
block, inode, etc. numbers to be moved around in translations.  (And
the recent update to the Spanish po file takes advantage of this
feature.)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agodebian: decrease priority of e2fsprogs from required to important
Theodore Ts'o [Wed, 1 Jan 2025 04:45:52 +0000 (23:45 -0500)]
debian: decrease priority of e2fsprogs from required to important

Addresses-Debian-Bug: #897277
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update zh_CN.po (from translationproject.org)
Wenbin Lv [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update zh_CN.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update uk.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update sv.po (from translationproject.org)
Göran Uddeborg [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update sv.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update ro.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update pl.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update ms.po (from translationproject.org)
Sharuzzaman Ahmat Raslan [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update ms.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update fr.po (from translationproject.org)
Samuel Thibault [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update fr.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update es.po (from translationproject.org)
Antonio Ceballos [Tue, 31 Dec 2024 23:41:35 +0000 (18:41 -0500)]
po: update es.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agopo: update cs.po (from translationproject.org)
Petr Pisar [Tue, 31 Dec 2024 23:41:34 +0000 (18:41 -0500)]
po: update cs.po (from translationproject.org)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agodebian: sort the symbol list for libext2fs2t64
Theodore Ts'o [Mon, 16 Dec 2024 05:00:21 +0000 (00:00 -0500)]
debian: sort the symbol list for libext2fs2t64

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 months agodebian: disable salsa CI on non-debian branches
Theodore Ts'o [Mon, 16 Dec 2024 04:16:05 +0000 (23:16 -0500)]
debian: disable salsa CI on non-debian branches

The Salsa CI attempts to do a package build, and the debian/patches
directory is generally not set up correctly for a successful source
build on non-debian branches.  So skip them to avoid failed builds and
to avoid wasting CI bandwidth.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agorezize2fs: fix memory leak when fixing up the orphan file inode
Theodore Ts'o [Wed, 11 Dec 2024 04:59:59 +0000 (23:59 -0500)]
rezize2fs: fix memory leak when fixing up the orphan file inode

Fixes: ff4f46b4fdb2 ("resize2fs: rewrite the checksums in the orphan...")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agolibext2fs: fix compiler warning in ext2fs_orphan_file_block_csum_set()
Theodore Ts'o [Tue, 10 Dec 2024 04:48:50 +0000 (23:48 -0500)]
libext2fs: fix compiler warning in ext2fs_orphan_file_block_csum_set()

Fixes: daf2d1c830d9 ("libext2fs: fix ext2fs_orphan_file_block_csum_set()")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebugfs: add a new command to list the orphan inodes
Theodore Ts'o [Tue, 10 Dec 2024 03:35:16 +0000 (22:35 -0500)]
debugfs: add a new command to list the orphan inodes

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoe2fsck: clear the orphan_file while processing it
Theodore Ts'o [Mon, 9 Dec 2024 22:19:26 +0000 (17:19 -0500)]
e2fsck: clear the orphan_file while processing it

Previously, we cleared the orphan file after pass 5.  This was
unfortunate, because it means that the file system is left in a
corrupted state after running "e2fsck -E journal_only".  By fixing
this, we can also remove a spurious "Orpan file... is not clean"
report from e2fsck.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agotests: check updating the orphan file checksums during an offline resize
Theodore Ts'o [Sun, 8 Dec 2024 04:56:47 +0000 (23:56 -0500)]
tests: check updating the orphan file checksums during an offline resize

Check to make sure resize2fs correctly update the orphan file's
checksums if the orphan_file's blocks get moved.

This test checks the fix in commit ff4f46b4fdb2 ("resize2fs: rewrite
the checksums in the orphan file if necessary").

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoresize2fs: rewrite the checksums in the orphan file if necessary
Theodore Ts'o [Sun, 8 Dec 2024 04:31:43 +0000 (23:31 -0500)]
resize2fs: rewrite the checksums in the orphan file if necessary

The calculation of the metadata checksum located in each block of the
orphan file's inode includes the physical block number.  So if any of
those blocks have been moved, the checksum needs to be updated.

Reported-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agotests: fix m_rootgnutar expect script
Theodore Ts'o [Fri, 6 Dec 2024 06:02:00 +0000 (01:02 -0500)]
tests: fix m_rootgnutar expect script

Fixes: 62fe2f4df048 ("misc/mke2fs.c: suppress 'Creating regular file' message with -q")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agolibext2fs: fix ext2fs_orphan_file_block_csum_set()
Theodore Ts'o [Thu, 5 Dec 2024 21:34:42 +0000 (16:34 -0500)]
libext2fs: fix ext2fs_orphan_file_block_csum_set()

The function ext2fs_orphan_file_block_csum_set() isn't used by
e2fsprogs, but it was embarassingly broken.  Thanks to Darrick Wong
for pointing this out.

Fixes: 16534ff59444 ("e2fsck: fix big-endian support for orphan_file...")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebian: add a suggestion of libarchive13t64 to e2fsprogs
Theodore Ts'o [Thu, 5 Dec 2024 20:35:15 +0000 (15:35 -0500)]
debian: add a suggestion of libarchive13t64 to e2fsprogs

Addresses-Debian-Bug: #1089085
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomke2fs: remove deprecated -r option from the usage message
Theodore Ts'o [Thu, 5 Dec 2024 17:08:18 +0000 (12:08 -0500)]
mke2fs: remove deprecated -r option from the usage message

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodumpe2fs: add support for LABEL= and UUID= specifiers for the device
Theodore Ts'o [Thu, 5 Dec 2024 05:23:09 +0000 (00:23 -0500)]
dumpe2fs: add support for LABEL= and UUID= specifiers for the device

The e2mmpstatus man page claims that it will support LABEL= and UUID=
specifiers, and these days e2mmpstatus is implemented in terms of
dumpe2fs.  So teach dumpe2fs to handle these specifiers so we can make
the e2mmpstatus man page be true.

https://github.com/tytso/e2fsprogs/issues/106

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomisc: fix potential memory leak in create_inode_libarchive.c
Theodore Ts'o [Thu, 5 Dec 2024 03:41:20 +0000 (22:41 -0500)]
misc: fix potential memory leak in create_inode_libarchive.c

Fix a potential memory leak on an error path.

Also handle the case where strdup() fails, and remove a redundant
test.

Addresses-Coverity-Bug: 1636564
Addresses-Coverity-Bug: 1636565
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoMerge branch 'be_quiet' of https://github.com/josch/e2fsprogs into next
Theodore Ts'o [Thu, 5 Dec 2024 03:26:44 +0000 (22:26 -0500)]
Merge branch 'be_quiet' of https://github.com/josch/e2fsprogs into next

6 months agoFix portability for systems which don't have dlopen or libarchive
Theodore Ts'o [Thu, 5 Dec 2024 03:08:46 +0000 (22:08 -0500)]
Fix portability for systems which don't have dlopen or libarchive

Fixes: ecfd4dd1217a ("Decouple --without-libarchive and HAVE_ARCHIVE_H")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agofix portability problem with uselocale(), et. al.
Theodore Ts'o [Thu, 5 Dec 2024 01:25:32 +0000 (20:25 -0500)]
fix portability problem with uselocale(), et. al.

misc/create_inode_libarchive.c uses uselocale(), newlocale(), et. al.
These functions are defined in POSIX.1-2017, which isn't available
everywhere --- including MacOS and Windows.

We don't actually need to use these functions, since mke2fs already
calls setlocale() to initialize to use the default locale.  So there
was no reason to set and restore the locale to use exactly the default
locale.

Fixes: ecfd4dd1217a ("Decouple --without-libarchive and HAVE_ARCHIVE_H")
Fixes: 7e3a4f0a33e9 ("mke2fs: the -d option can now handle tarball input")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoMore release note updates for 1.47.2.
Theodore Ts'o [Wed, 4 Dec 2024 04:44:26 +0000 (23:44 -0500)]
More release note updates for 1.47.2.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebian: fix fuseext2 transition to account for /usr-move
Theodore Ts'o [Wed, 4 Dec 2024 04:06:43 +0000 (23:06 -0500)]
debian: fix fuseext2 transition to account for /usr-move

Addresses-Debian-Bug: #1088838
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoe2fsck: fix big-endian support for orphan_file file systems
Theodore Ts'o [Wed, 4 Dec 2024 04:03:13 +0000 (23:03 -0500)]
e2fsck: fix big-endian support for orphan_file file systems

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomke2fs: allow specifying the revision 1 via "-r 1"
Theodore Ts'o [Tue, 3 Dec 2024 23:23:51 +0000 (18:23 -0500)]
mke2fs: allow specifying the revision 1 via "-r 1"

The fsarchiver program unconditionally passes -r 1 even though it's
effectively a no-op.  To avoid commit 3fffe9dd6be5 breaking
fsarchiver, we'll silently allow the "-r 1" option instead of printing
an error and exiting.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoDecouple --without-libarchive and HAVE_ARCHIVE_H
Johannes Schauer Marin Rodrigues [Tue, 3 Sep 2024 11:15:33 +0000 (13:15 +0200)]
Decouple --without-libarchive and HAVE_ARCHIVE_H

To aid bootstrapping, it would be useful to be able to build e2fsprogs
without archive.h as otherwise there is a build dependency loop with
libarchive. If archive.h is not present, add the missing forward
declarations (as opaque structs) and preprocessor definitions and
typedefs. Since this allows building e2fsprogs with libarchive support
even without the archive.h header present on the system, we cannot check
HAVE_ARCHIVE_H anymore to decide whether to build with libarchive
support or not. So if --without-libarchive is passed to ./configure,
CONFIG_DISABLE_LIBARCHIVE gets set and later checked to decide about
libarchive support.

Addresses-Debian-Bug: #1078693
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebian: fix some typos in debian/changelog
Theodore Ts'o [Mon, 2 Dec 2024 12:53:47 +0000 (07:53 -0500)]
debian: fix some typos in debian/changelog

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoUpdate release notes, etc., for the 1.47.2 release
Theodore Ts'o [Fri, 29 Nov 2024 07:16:28 +0000 (02:16 -0500)]
Update release notes, etc., for the 1.47.2 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomke2fs: accept gnu.translator xattrs in tar files fed to mke2fs -d
Johannes Schauer Marin Rodrigues [Mon, 26 Aug 2024 22:45:16 +0000 (00:45 +0200)]
mke2fs: accept gnu.translator xattrs in tar files fed to mke2fs -d

https://github.com/tytso/e2fsprogs/issues/192
https://github.com/tytso/e2fsprogs/pull/194

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agotests/fuzz: fix memory leak from repeatedly calling add_error_table()
Theodore Ts'o [Thu, 28 Nov 2024 18:21:20 +0000 (13:21 -0500)]
tests/fuzz: fix memory leak from repeatedly calling add_error_table()

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebian: provide fuseext2 to replace src:fuse-umfuse-ext2
наб [Thu, 28 Nov 2024 17:48:58 +0000 (12:48 -0500)]
debian: provide fuseext2 to replace src:fuse-umfuse-ext2

The fuse-umfuse-ext2 packaghas been abandoned by upstream, and a
follow-up fork at https://github.com/alperakcan/fuse-ext2 hasn't been
updated in five years.  Both of these versions also warn against
mounting file systems read/write with fuse-ext2.

As proposed on debian-devel, let's replace fuse-umfuse-ext2 with a
compatibility shell script shipped with fuse2fs.

Link: https://lists.debian.org/debian-devel/2024/10/msg00231.html
Addresses-Debian-Bug: #1085590
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agolibext2fs: fix -std=c23 build failure
Rudi Heitbaum [Fri, 22 Nov 2024 12:36:32 +0000 (12:36 +0000)]
libext2fs: fix -std=c23 build failure

gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result `e2fsprogs` fails the build so only typedef int bool
for __STDC_VERSION__ <= 201710L (C17)

    ../../../lib/ext2fs/tdb.c:113:13: error: two or more data types in declaration specifiers
    ../../../lib/ext2fs/tdb.c:113:1: warning: useless type name in empty declaration
      113 | typedef int bool;
          | ^~~~~~~

https://github.com/tytso/e2fsprogs/issues/202

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://lore.kernel.org/r/Z0B60JhdvT9bpSQ6@6f91903e89da
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agoext4.5, tune2fs.8: add documentation for the orphan_file feature
Theodore Ts'o [Thu, 28 Nov 2024 03:37:52 +0000 (22:37 -0500)]
ext4.5, tune2fs.8: add documentation for the orphan_file feature

Add documentation for the orphan_file feature to the ext4(5) and
tune2fs(8) man pages.

Addresses-Debian-Bug: #1073062
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agobadblocks: avoid an error when -n or -w is specified twice
Theodore Ts'o [Thu, 28 Nov 2024 03:34:57 +0000 (22:34 -0500)]
badblocks: avoid an error when -n or -w is specified twice

Fix a bug where if the user specifies the -n or -w command-line option
twice, badblocks will issue a misleading (and incorrect) error
message.

Addresses-Debian-Bug: #1087341
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agodebugfs: clean up groff warnings in the debugfs.8 man page
Theodore Ts'o [Thu, 28 Nov 2024 01:16:29 +0000 (20:16 -0500)]
debugfs: clean up groff warnings in the debugfs.8 man page

Addresses-Debian-Bug: #1086892
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomisc: clean up groff warnings in the e2image.8 man page
Theodore Ts'o [Thu, 28 Nov 2024 00:28:34 +0000 (19:28 -0500)]
misc: clean up groff warnings in the e2image.8 man page

Addresses-Debian-Bug: #1082787
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomisc: clean up groff warnings in the ext4.5 man page
Theodore Ts'o [Wed, 27 Nov 2024 18:53:19 +0000 (13:53 -0500)]
misc: clean up groff warnings in the ext4.5 man page

Addresses-Debian-Bug: #1072866
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomisc: clean up groff warnings in the mek2fs.8 man page
Theodore Ts'o [Wed, 27 Nov 2024 18:36:17 +0000 (13:36 -0500)]
misc: clean up groff warnings in the mek2fs.8 man page

Addresses-Debian-Bug: #1087898
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agotune2fs: replace the -r option with -E revision=<fs-rev>
Theodore Ts'o [Wed, 27 Nov 2024 18:03:38 +0000 (13:03 -0500)]
tune2fs: replace the -r option with -E revision=<fs-rev>

Revision 0 file systems are needed for compatibility with pre-1995
Linux kernels (older that version 1.2).  Other for testing and
computer science archoelogy, there are no valid reasons for using this
feature.  Revision 0 file systms do not support any file system
extensions beyond what was present in Linux 1.0 kernels, and only
support 128 byte inode sizes, which means that the file system will
only support file dates after the Unix epoch in 2038.

Users who use -r 0 are almost certainly doing so by mistake (for
example, perhaps they meant -m 0 but they typed -r 0 instead).  As a
result they get a very badly cripped file system that won't support
SELinux, post-2038 dates, on-line resizing, etc.  So remove the -r
option and replace it with the extended option "revision", to prevent
users from falling into this trap.

Addresses-Debian-Bug: #1086603
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agotune2fs: update revision 0 file systems before changing the inode size
Theodore Ts'o [Tue, 26 Nov 2024 05:42:14 +0000 (00:42 -0500)]
tune2fs: update revision 0 file systems before changing the inode size

Revsion 0 file systems only support the fixed 128 byte inode size.  So
before changing the inode size via tune2fs -I, we must first update
the file system to revision 1.

Addresses-Debian-Bug: #1086603
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agomisc: sort the extended and journal options in man pages for tune2fs/mke2fs
Theodore Ts'o [Wed, 27 Nov 2024 08:20:40 +0000 (03:20 -0500)]
misc: sort the extended and journal options in man pages for tune2fs/mke2fs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 months agofuse2fs: fix fuse2fs --helpfull
Theodore Ts'o [Tue, 26 Nov 2024 05:28:43 +0000 (00:28 -0500)]
fuse2fs: fix fuse2fs --helpfull

https://github.com/tytso/e2fsprogs/issues/204

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agoresize2fs: check number of group descriptors only if meta_bg is disabled
Jan Kara [Wed, 25 Sep 2024 17:19:26 +0000 (19:19 +0200)]
resize2fs: check number of group descriptors only if meta_bg is disabled

When meta_bg feature is enabled, the total number of group descriptors
is not really limiting the filesystem size. So there's no reason to
check it in that case. This allows resize2fs to resize filesystems past
256TB boundary similarly as the kernel can do it.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20240925171926.11354-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agotune2fs: only set the superblock as dirty if the default group is modified
Gwendal Grignou [Thu, 18 Jul 2024 17:52:04 +0000 (10:52 -0700)]
tune2fs: only set the superblock as dirty if the default group is modified

Similar to commit 2eb3b20e80, it speeds up `tunefs -g` command when
the group argument is identical.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20240718175204.1590917-1-gwendal@chromium.org
7 months agotests: new test to check that the orphan file is cleaned up
Luis Henriques (SUSE) [Tue, 11 Jun 2024 14:27:04 +0000 (15:27 +0100)]
tests: new test to check that the orphan file is cleaned up

This test verifies that e2fsck clears the orphan file if it is present.
The filesystem was created by simply creating a bunch of empty files and,
while those files were open by an application, delete some of them in
order to add them to the orphan file.  After this, the filesystem is
simply powered off.  An e2fsck will need to clear the orphaned inodes but
also to clean the orphan file.

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Link: https://lore.kernel.org/r/20240611142704.14307-3-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agoe2fsck: don't skip checks if the orphan file is present in the filesystem
Luis Henriques (SUSE) [Tue, 11 Jun 2024 14:27:03 +0000 (15:27 +0100)]
e2fsck: don't skip checks if the orphan file is present in the filesystem

If the filesystem supports the orphan file feature and that file is present
then don't skip the filesystem checks as that file may need to be cleaned
up.

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Link: https://lore.kernel.org/r/20240611142704.14307-2-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agotests: write f_badjour_encrypted output to log
Andreas Dilger [Wed, 5 Jun 2024 20:03:52 +0000 (14:03 -0600)]
tests: write f_badjour_encrypted output to log

Write the mke2fs and debugfs output from f_badjour_encrypted/script
into a log file instead of stdout/stderr, so that it doesn't mess
up the "make check" output, and is available if this test ever fails.

   [ Fixed missing definition of $LOG -- TYT ]

Fixes: b0cd09e5 ("e2fsck: don't allow journal to have encrypt flag")
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20240605200408.55221-1-adilger@dilger.ca
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agoFix implicit my_llseek declaration error when targeting musl libc
Henrik Lindström [Sun, 2 Jun 2024 12:07:21 +0000 (14:07 +0200)]
Fix implicit my_llseek declaration error when targeting musl libc

Signed-off-by: Henrik Lindström <henrik@lxm.se>
Link: https://lore.kernel.org/r/20240602120721.387561-1-henrik@lxm.se
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agofuse2fs: explicitly set _FILE_OFFSET_BITS again
Darrick J. Wong [Wed, 29 May 2024 18:12:14 +0000 (11:12 -0700)]
fuse2fs: explicitly set _FILE_OFFSET_BITS again

In commit 3ab99d9b602, the build system was changed not to set
_FILE_OFFSET_BITS explicitly due to some weird error on mips64el.
Unfortunately, this breaks the aarch64 Debian build because libfuse
2.9.9 requires this value to be set explicitly.  Restore this dumb
preprocessor symbol dependency with even more hackery as documented in
the commit.

Fixes: 3ab99d9b602 ("Remove explicit #define of _FILE_OFFSET_BITS")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20240529181214.GA52969@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agoconfigure: add SIZEOF_TIME_T to public_config.h
Alyssa Ross [Mon, 27 May 2024 07:41:21 +0000 (09:41 +0200)]
configure: add SIZEOF_TIME_T to public_config.h

This has recently started being used by ext2fs.h.  Other users of the
ext2fs.h header would always get the 32-bit versions of the
__encode_extra_time, __decode_extra_sec, and __sb_set_tstamp; and the
64-bit version of __sb_get_tstamp, due to the SIZEOF_TIME_T macro
being undefined and treated as zero.

Fixes: 5b599a32 ("Fix 32-bit build and test failures")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Link: https://lore.kernel.org/r/20240527074121.2767083-1-hi@alyssa.is
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 months agolibext2fs: fix unused parameter warnings/errors
Alyssa Ross [Tue, 28 May 2024 13:18:41 +0000 (15:18 +0200)]
libext2fs: fix unused parameter warnings/errors

This fixes building dependent packages that use -Werror.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Link: https://lore.kernel.org/r/20240528131841.576999-1-hi@alyssa.is
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 months agodebian: enable Salsa Continuous Integration testing
Theodore Ts'o [Fri, 23 Aug 2024 21:40:38 +0000 (17:40 -0400)]
debian: enable Salsa Continuous Integration testing

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 months agoext4.5: add preprocessor hint
Theodore Ts'o [Tue, 21 May 2024 02:52:47 +0000 (22:52 -0400)]
ext4.5: add preprocessor hint

This fixes a Lintian warning which is triggered by an arbtrary
MANROFFSEQ='' environment variable:

an.tmac:<standard input>:376: warning: tbl preprocessor failed, or it or soelim was not run; table(s) likely not rendered (TE macro called with TW register undefined)

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 months agoUpdate release notes, etc., for the 1.47.1 release
Theodore Ts'o [Mon, 20 May 2024 19:31:17 +0000 (15:31 -0400)]
Update release notes, etc., for the 1.47.1 release

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 months agoUpdate makefile dependencies
Theodore Ts'o [Mon, 20 May 2024 19:46:10 +0000 (15:46 -0400)]
Update makefile dependencies

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