Whamcloud - gitweb
tune2fs: check return value of ext2fs_mmp_update2 in rewrite_metadata_checksums
authorlihaoxiang (F) <lihaoxiang9@huawei.com>
Tue, 29 Nov 2022 06:58:12 +0000 (14:58 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 26 Jan 2023 02:29:30 +0000 (21:29 -0500)
commitf7c9598655420102353ff87946f5bf77ebf465bc
treea01df2217856f923331333cbac1bfc422d256e26
parent13d69f3596ad49633be586bb0594452ccd2301ce
tune2fs: check return value of ext2fs_mmp_update2 in rewrite_metadata_checksums

Tune2fs hasn't consider about the result of executing ext2fs_mmp_update2
when it try to rewrite_metadata_checksums. If the ext2fs_mmp_update2
failed, multi-mount protection couldn't guard there has the only node
(i.e. this program) accessing this device in the meantime.

We solve this problem to verify the return value of ext2fs_mmp_update2.
It terminate rewrite_metadata_checksums and exit immediately if the
wrong error code returned.

Signed-off-by: lihaoxiang <lihaoxiang9@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c