linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [e2fsprogs] Bug in salvage_directory
@ 2007-07-09  9:32 Kalpak Shah
  2007-07-09 16:50 ` Theodore Tso
  0 siblings, 1 reply; 7+ messages in thread
From: Kalpak Shah @ 2007-07-09  9:32 UTC (permalink / raw)
  To: TheodoreTso; +Cc: linux-ext4, Andreas Dilger

Hi Ted,

Recently, one of our customers found this message in pass2 of e2fsck while doing some regression testing:
"Entry '4, 0x695a, 0x81ff, 0x0040, 0x8320, 0xa192, 0x0021' in ??? (136554) has
rec_len of 14200, should be 26908."

Both the displayed rec_len and the "should be" value are bogus. The reason is that salvage_directory sets a offset beyond blocksize leading to bogus messages.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>

Index: e2fsprogs-1.39/e2fsck/pass2.c
===================================================================
--- e2fsprogs-1.39.orig/e2fsck/pass2.c
+++ e2fsprogs-1.39/e2fsck/pass2.c
@@ -690,7 +690,10 @@ static void salvage_directory(ext2_filsy
 	 */
 	if (prev && dirent->rec_len && (dirent->rec_len % 4) == 0) {
 		prev->rec_len += dirent->rec_len;
-		*offset += dirent->rec_len;
+		if (*offset + dirent->rec_len <= fs->blocksize)
+			*offset += dirent->rec_len;
+		else
+			*offset = fs->blocksize;
 		return;
 	}
 	/*


Thanks,
Kalpak.

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

end of thread, other threads:[~2007-07-10  6:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-09  9:32 [e2fsprogs] Bug in salvage_directory Kalpak Shah
2007-07-09 16:50 ` Theodore Tso
2007-07-09 17:52   ` Kalpak Shah
2007-07-09 18:29     ` Theodore Tso
2007-07-09 19:17       ` Andreas Dilger
2007-07-09 20:20         ` Theodore Tso
     [not found]     ` <20070709230234.GE2343@thunk.org>
2007-07-10  6:47       ` Kalpak Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).