[PATCH] e2fsprogs: Add missed ext2fs_close

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
 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


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux