Whamcloud - gitweb
LU-13672 tune2fs: reset MMP state on error exit 26/38926/2
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 12 Jun 2020 21:21:48 +0000 (15:21 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 17 Jun 2020 08:50:09 +0000 (08:50 +0000)
commit6133d63daa9d51922bc23417ca2aa46d544d9e78
tree0ddb0ef6ee75576ded6a801d049838626d219359
parentab3ebc4782c04ae25568a17e456c29441a0ce044
LU-13672 tune2fs: reset MMP state on error exit

If tune2fs cannot perform the requested change, ensure that the MMP
block is reset to the unused state before exiting.  Otherwise, the
filesystem will be left with mmp_seq = EXT4_MMP_SEQ_FSCK set, which
prevents it from being mounted afterward:

    LDISKFS-fs warning (device dm-9): ldiskfs_multi_mount_protect:311:
        fsck is running on the filesystem

Add a test to try some failed tune2fs operations and verify that the
MMP block is left in a clean state afterward.

Change-Id: I3a5acc5875fa2d082a66e751ec4b326ffe3ebbe5
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38926
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>
misc/tune2fs.c
tests/t_mmp_2off/script
tests/t_mmp_fail/is_slow_test [new file with mode: 0644]
tests/t_mmp_fail/name [new file with mode: 0644]
tests/t_mmp_fail/script [new file with mode: 0644]