Whamcloud - gitweb
LU-17117 debugfs: allow debugfs to disable MMP directly
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 15 Sep 2023 00:42:15 +0000 (18:42 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Tue, 28 May 2024 05:53:20 +0000 (15:53 +1000)
commitb0c6a2288572ba4de5ae494b93e647d04d097784
tree33a57a313b2915a0c03d4f4ddfccb34ac0893f7a
parent795588ee973b739879fcc5e70651cb5b680e31ae
LU-17117 debugfs: allow debugfs to disable MMP directly

Instead of needing to use "tune2fs -f -E clear_mmp" to clear the
MMP status, it should be possible to open and clear the MMP block
directly with debugfs in case of issues with tune2fs.

Add the "-m" option to debugfs and the "open" command to allow
opening the device and skipping the MMP status check.  Otherwise,
if sequence EXT4_MMP_SEQ_FSCK is set then debugfs will report an
error and the device cannot be not opened for write, even with -f:

    debugfs -f /dev/sdc
    MMP: e2fsck being run while trying to open /dev/sdc

Add the "clear_mmp" command to match the tune2fs extended command.
Add command aliases "mmp_clear", "mmp_dump", and "mmp_set_value"
so that they can be grouped together and found more easily.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I580ba4f30c366b0d0e75596c80cef2892c408fb0
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/52380
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
debugfs/debug_cmds.ct
debugfs/debugfs.8.in
debugfs/debugfs.c
misc/tune2fs.c