e2fsck: avoid unnecessary close/reopen for non-MMP filesystems
PATCH 1/1 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" <[email protected]>
Cc Andreas Dilger <[email protected]>
--- e2fsck/unix.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
e2fsck/unix.c +3 -5
@@ -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 ;
Signature · 1 line
1.7.9.107.g97f9a
Quoted 5 lines · Theodore Ts'o
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_MMPhas no meaning for non-MMP file systems anyway.Signed-off-by "Theodore Ts'o" <[email protected]>
Not sure how those two identical checks ended up next to each other.
Acked-by Andreas Dilger <[email protected]>
Quoted 27 lines
---
e2fsck/unix.c| 8 +++-----1 files changed, 3 insertions(+), 5 deletions(-)e2fsck/unix.c +3
-5@@ -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 ;Signature · 1 line
1.7.9.107.g97f9a