From: Nikita Danilov <Nikita@Namesys.COM>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
alexander viro <viro@parcelfarce.linux.theplanet.co.uk>,
trond myklebust <trondmy@trondhjem.org>,
neil brown <neilb@cse.unsw.edu.au>
Subject: Re: d_splice_alias() problem.
Date: Fri, 23 Apr 2004 20:20:50 +0400 [thread overview]
Message-ID: <16521.16994.676933.323590@laputa.namesys.com> (raw)
In-Reply-To: <20040423154038.GM2938@schnapps.adilger.int>
Andreas Dilger writes:
> On Apr 23, 2004 17:02 +0400, Nikita Danilov wrote:
> > Suppose we have an inode with ->i_nlink == 1. It's accessed over NFS and
> > DCACHE_DISCONNECTED dentry D1 is created for it. Then, unlink request
> > comes for this file. nfsd looks name up in the parent directory
> > (nfsd_unlink()->lookup_one_len()). File system back-end uses
> > d_splice_alias(), but it only works for directories and we end up with
> > second (this time connected) dentry D2.
> >
> > It's hard to imagine how new name can be identified with one among
> > multiple anonymous dentries, which is necessary for
> > NFSEXP_NOSUBTREECHECK export to work reliably.
> >
> > One possible work-around is to forcibly destroy all remaining
> > DCACHE_DISCONNECTED dentries when ->i_nlink drops to zero, but I am not
> > sure that this is possible and solves all problems of having more
> > dentries than there are nlinks.
>
> We use a patch for Lustre which solves this problem. When there is
> a lookup-by-inum done on the server there is the possibility to get a
> DISCONNECTED dentry as you say. However, if we ever do another lookup
> on this inode we verify that either this is a disconnected dentry and
> return the existing dentry, or if it is a connected dentry we essentially
> "rename" the disconnected dentry and connect it to the tree and return
> that. There can never be both connected and disconnected dentry aliases
> on an inode at one time.
I am not sure I understand this description correctly, but it looks
pretty much like what d_splice_alias() is supposed to do according to
the comment on top of it.
What I missed is that inode can have no more than one disconnected
dentry even if it has multiple names. Hence when lookup-by-name happens
list we can d_move disconnected dentry in place of the named one. This
is no worse that what is done currently by d_find_alias() that
identifies disconnected dentry with arbitrary connected.
>
> This is handled inside the ext3 lookup code, I'm not sure how easy/hard
> it would be to make a generic VFS patch to do the same.
>
> Cheers, Andreas
Nikita.
next prev parent reply other threads:[~2004-04-23 16:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-23 13:02 Nikita Danilov
2004-04-23 15:40 ` Andreas Dilger
2004-04-23 16:20 ` Nikita Danilov [this message]
2004-04-23 23:49 ` Andrew Morton
2004-04-26 12:45 ` Nikita Danilov
2004-04-30 4:54 ` Neil Brown
2004-04-30 7:50 ` Greg Banks
2004-04-30 13:28 ` Nikita Danilov
2004-05-03 23:46 ` Neil Brown
2004-05-03 12:02 ` Greg Banks
2004-05-03 23:28 ` Neil Brown
2004-05-04 0:05 ` Greg Banks
2004-05-04 7:00 ` Greg Banks
2004-05-04 9:46 ` viro
2004-05-04 10:21 ` Greg Banks
2004-05-05 0:11 ` Neil Brown
2004-05-10 3:03 ` Neil Brown
2004-05-10 4:50 ` Greg Banks
2004-05-10 3:27 ` Neil Brown
2004-05-10 11:28 ` Greg Banks
2004-05-13 5:58 ` Neil Brown
2004-05-13 7:15 ` Greg Banks
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=16521.16994.676933.323590@laputa.namesys.com \
--to=nikita@namesys.com \
--cc=adilger@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@cse.unsw.edu.au \
--cc=trondmy@trondhjem.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/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®