From: Theodore Ts'o Date: Thu, 22 Mar 2012 03:18:49 +0000 (-0400) Subject: e2fsck: avoid unnecessary close/reopen for non-MMP filesystems X-Git-Tag: v1.42.2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=349b8a37c5077086f1cd57c6b1b13ec275af6a43;p=thirdparty%2Fe2fsprogs.git e2fsck: avoid unnecessary close/reopen for non-MMP filesystems For file systems that do not use MMP, there's no reason to close the file system and then re-open the file system a second time, since EXT2_FLAG_SKIP_MMP has no meaning for non-MMP file systems anyway. Signed-off-by: "Theodore Ts'o" Cc: Andreas Dilger --- diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 59c52ff33..d0b10d494 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1398,12 +1398,10 @@ failure: (flags & EXT2_FLAG_SKIP_MMP)) { if (e2fsck_check_mmp(fs, ctx)) fatal_error(ctx, 0); - } - /* - * Restart in order to reopen fs but this time start mmp. - */ - if (flags & EXT2_FLAG_SKIP_MMP) { + /* + * Restart in order to reopen fs but this time start mmp. + */ ext2fs_close(fs); ctx->fs = NULL; flags &= ~EXT2_FLAG_SKIP_MMP;