From: Theodore Ts'o Date: Mon, 5 Jul 2010 19:06:37 +0000 (-0400) Subject: e2fsck: Add missing ext2fs_close() call when going back to original superblock X-Git-Tag: v1.41.13~44 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=22ff06d5f7a90914f7a90bae420e5be7d2e02ce3;p=tools%2Fe2fsprogs.git e2fsck: Add missing ext2fs_close() call when going back to original superblock In the case where the original superblock and the backup superblock are both invalid in some way, e2fsck will try to go back to the orignal superblock. To do that, it must close the attempted open using the backup superblock first (since otherwise the exclusive open will prevent the subsequent open from succeding). Signed-off-by: Dmitry Monakhov Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 34fa9b1..4a299ef 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1054,6 +1054,8 @@ restart: orig_retval = retval; retval = try_open_fs(ctx, flags, io_ptr, &fs); if ((orig_retval == 0) && retval != 0) { + if (fs) + ext2fs_close(fs); com_err(ctx->program_name, retval, "when using the backup blocks"); printf(_("%s: going back to original "