linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] e2fsprogs - pass1c terminates early if hard links
@ 2007-04-10 20:51 Jim Garlick
  2007-04-10 22:39 ` [PATCH] e2fsprogs - e2fsck pass1c does extra work if root dir has shared blocks Jim Garlick
  2007-04-11  3:40 ` [PATCH] e2fsprogs - pass1c terminates early if hard links Theodore Tso
  0 siblings, 2 replies; 8+ messages in thread
From: Jim Garlick @ 2007-04-10 20:51 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4

Ted,

I think this is a small buglet in e2fsck:  if a file has multiple hard 
links, e2fsck pass1c search_dirent_proc() doesn't maintain its count 
properly and may return DIRENT_ABORT before it has found containing 
directories for all inodes sharing blocks.

Signed-off-by: Jim Garlick <garlick@llnl.gov>

Index: e2fsprogs+chaos/e2fsck/pass1b.c
===================================================================
--- e2fsprogs+chaos.orig/e2fsck/pass1b.c
+++ e2fsprogs+chaos/e2fsck/pass1b.c
@@ -372,8 +372,10 @@ static int search_dirent_proc(ext2_ino_t
  	if (!n)
  		return 0;
  	p = (struct dup_inode *) dnode_get(n);
-	p->dir = dir;
-	sd->count--;
+	if (!p->dir) {
+		p->dir = dir;
+		sd->count--;
+	}

  	return(sd->count ? 0 : DIRENT_ABORT);
  }

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

end of thread, other threads:[~2007-04-20 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10 20:51 [PATCH] e2fsprogs - pass1c terminates early if hard links Jim Garlick
2007-04-10 22:39 ` [PATCH] e2fsprogs - e2fsck pass1c does extra work if root dir has shared blocks Jim Garlick
2007-04-20 12:14   ` Theodore Tso
2007-04-11  3:40 ` [PATCH] e2fsprogs - pass1c terminates early if hard links Theodore Tso
2007-04-11  4:22   ` Andreas Dilger
2007-04-11 10:42     ` Theodore Tso
2007-04-11 11:51       ` Andreas Dilger
2007-04-11 12:57         ` Theodore Tso

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).