diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-07-05 15:06:37 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-07-05 15:06:37 -0400 |
commit | 22ff06d5f7a90914f7a90bae420e5be7d2e02ce3 (patch) | |
tree | b9f8e94d6cc6f365ffeb200623709fe5d74c7595 /e2fsck | |
parent | b887f08f959fa3ef4ead9b6e2fd71becf4877a40 (diff) | |
download | e2fsprogs-22ff06d5f7a90914f7a90bae420e5be7d2e02ce3.tar.gz |
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 <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/unix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 34fa9b14..4a299ef2 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 " |