From: Jim Garlick <garlick@llnl.gov>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH] e2fsprogs - pass1c terminates early if hard links
Date: Tue, 10 Apr 2007 13:51:12 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.61.0704101344050.29750@webb> (raw)
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);
}
next reply other threads:[~2007-04-10 20:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 20:51 Jim Garlick [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0704101344050.29750@webb \
--to=garlick@llnl.gov \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox