linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, torvalds@osdl.org
Subject: Re: BUG fs/dcache.c:595 in 2.4.24rc3-git3 during NFS umount
Date: Tue, 11 Dec 2007 21:54:44 -0500	[thread overview]
Message-ID: <1197428085.28126.3.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20071210185720.GA32466@bingen.suse.de>

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


On Mon, 2007-12-10 at 19:57 +0100, Andi Kleen wrote:
> > Hi Andi,
> > 
> > Does the attached patch fix the Oops?
> 
> Nope, got that a few hours after boot again:
> 
> -Andi

Hi Andi,

I appear to have misread d_find_alias(). It would seem that the only way
to ensure that a mountpoint won't be found is to remove it altogether
from the inode->i_dentry list. AFAICS that should be largely harmless
since the nfs sb->s_root is never visible to users, and is never part of
a dentry tree.

Cheers
  Trond


[-- Attachment #2: linux-2.6.24-003-fix_oops_in_nfs_unmount.dif --]
[-- Type: message/rfc822, Size: 1352 bytes --]

From: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: NFS: Fix an Oops in NFS unmount
Date: 
Message-ID: <1197428085.28126.4.camel@heimdal.trondhjem.org>

Ensure that the dummy 'root dentry' is invisible to d_find_alias(). If not,
then it may be spliced into the tree if a parent directory from the same
filesystem gets mounted at a later time.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

 fs/nfs/getroot.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 0ee4384..e6242cd 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -57,6 +57,17 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
 		}
 		/* Circumvent igrab(): we know the inode is not being freed */
 		atomic_inc(&inode->i_count);
+		/*
+		 * Ensure that this dentry is invisible to d_find_alias().
+		 * Otherwise, it may be spliced into the tree by
+		 * d_materialise_unique if a parent directory from the same
+		 * filesystem gets mounted at a later time.
+		 * This again causes shrink_dcache_for_umount_subtree() to
+		 * Oops, since the test for IS_ROOT() will fail.
+		 */
+		spin_lock(&dcache_lock);
+		list_del_init(&sb->s_root->d_alias);
+		spin_unlock(&dcache_lock);
 	}
 	return 0;
 }

  reply	other threads:[~2007-12-12  2:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 15:23 BUG fs/dcache.c:595 in 2.4.24rc3-git3 during NFS umount Andi Kleen
2007-12-06 23:25 ` Andrew Morton
2007-12-08 13:22 ` Andi Kleen
2007-12-09 23:45   ` Trond Myklebust
2007-12-10 18:57     ` Andi Kleen
2007-12-12  2:54       ` Trond Myklebust [this message]
2007-12-12 23:42         ` Andi Kleen
2007-12-13  1:02           ` Trond Myklebust

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=1197428085.28126.3.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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;
as well as URLs for NNTP newsgroup(s).