All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsprogs: Add missed ext2fs_close
@ 2010-06-30 11:24 Dmitry Monakhov
  2010-07-05 19:10 ` tytso
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Monakhov @ 2010-06-30 11:24 UTC (permalink / raw)
  To: linux-ext4

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Today i've accidentally overwrote first GB of 400Gb ext4 filesystem with
zeroes :) . So journal, group descriptors, rootdir and etc was destroyed.
Surprisingly i've able to recover some of my data after long fsck
process. I've met only one trivial bug in initialization stage.
See patch attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-e2fsprogs-Add-missed-ext2fs_close.patch --]
[-- Type: text/x-diff, Size: 769 bytes --]

>From 57f41b37a08581f4be8e87c54d8da42d5cb62ddd Mon Sep 17 00:00:00 2001
From: root <root@ws-qual.sw.ru>
Date: Wed, 30 Jun 2010 15:06:36 +0400
Subject: [PATCH] e2fsprogs: Add missed ext2fs_close


Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 e2fsck/unix.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index bae3b38..273dbef 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -1061,6 +1061,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 "
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-05 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-30 11:24 [PATCH] e2fsprogs: Add missed ext2fs_close Dmitry Monakhov
2010-07-05 19:10 ` tytso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.