mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: "Henrik Grubbström" <grubba@grubba.org>
Cc: sct@redhat.com, akpm@osdl.org, neilb@cse.unsw.edu.au,
	linux-kernel@vger.kernel.org, ext2-devel@lists.sourceforge.net
Subject: Re: [PATCH] Support for dx directories in ext3_get_parent (NFSD)
Date: Mon, 9 May 2005 03:24:17 -0600	[thread overview]
Message-ID: <20050509092417.GF25935@schnapps.adilger.int> (raw)
In-Reply-To: <Pine.GSO.4.21.0505091032000.22820-100000@jms.roxen.com>

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

On May 09, 2005  10:57 +0200, Henrik Grubbström wrote:
> The 2.6.10 ext3_get_parent attempts to use ext3_find_entry to look up the
> entry "..", which fails for dx directories since ".." is not present in
> the directory hash table. The patch below solves this by looking up the
> dotdot entry in the dx_root block.
> 
> Typical symptoms of the above bug are intermittent claims by nfsd that
> files or directories are missing on exported ext3 filesystems.
> 
> cf https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150759
> and https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=144556
> 
> Signed-off-by: Henrik Grubbström <grubba@grubba.org>

ext3_get_parent() is IMHO the wrong place to fix this bug as it introduces
a lot of internals from htree into that function.  Instead, I think this
should be fixed in ext3_find_entry() as in the below patch.  This has the
added advantage that it works for any callers of ext3_find_entry() and not
just ext3_lookup_parent().

I thought I submitted this patch to l-k at one point, but now I can't find
any mention of that in the archives...

Signed-off-by: Andreas Diler <adilger@clusterfs.com>

--- linux-2.6.orig/fs/ext3/namei.c	2005-04-04 05:06:46.000000000 -0600
+++ linux-2.6/fs/ext3/namei.c	2005-04-04 05:09:18.000000000 -0600
@@ -926,8 +926,16 @@
 	struct inode *dir = dentry->d_parent->d_inode;
 
 	sb = dir->i_sb;
-	if (!(frame = dx_probe(dentry, NULL, &hinfo, frames, err)))
-		return NULL;
+	/* NFS may look up ".." - look at dx_root directory block */
+	if (namelen > 2 || name[0] != '.'||(name[1] != '.' && name[1] != '\0')){
+		if (!(frame = dx_probe(dentry, NULL, &hinfo, frames, err)))
+			return NULL;
+	} else {
+		frame = frames;
+		frame->bh = NULL;			/* for dx_release() */
+		frame->at = (struct dx_entry *)frames;	/* hack for zero entry*/
+		dx_set_block(frame->at, 0);		/* dx_root block is 0 */
+	}
 	hash = hinfo.hash;
 	do {
 		block = dx_get_block(frame->at);

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-05-09  9:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09  8:57 Henrik Grubbström
2005-05-09  9:24 ` Andreas Dilger [this message]
2005-05-09  9:46   ` Henrik Grubbström
2005-05-09 14:05     ` Stephen C. Tweedie
2005-05-09 14:59       ` Henrik Grubbström
     [not found] <42chI-3Rf-49@gated-at.bofh.it>
     [not found] ` <42cKy-4jT-9@gated-at.bofh.it>
2005-05-09 14:24   ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
2005-05-09 15:45     ` Stephen C. Tweedie
2005-05-09 16:55       ` Bodo Eggert

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=20050509092417.GF25935@schnapps.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=akpm@osdl.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=grubba@grubba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=sct@redhat.com \
    /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

all inboxes | Powered by JetHome®