linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org,
	"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 05/11] dcache: d_splice_alias should ignore DCACHE_DISCONNECTED
Date: Wed,  4 Jun 2014 17:20:57 -0400	[thread overview]
Message-ID: <1401916863-7916-6-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1401916863-7916-1-git-send-email-bfields@redhat.com>

From: "J. Bruce Fields" <bfields@redhat.com>

Any IS_ROOT() alias should be safe to use; there's nothing special about
DCACHE_DISCONNECTED dentries.

Note that this is in fact useful for filesystems such as btrfs which can
legimately encounter a directory with a preexisting IS_ROOT alias on a
lookup that crosses into a subvolume.  (Those aliases are currently
marked DCACHE_DISCONNECTED--but not really for any good reason, and
we'll change that soon.)

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/dcache.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 54b602e..c42009f 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2586,9 +2586,9 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
  * @inode:  the inode which may have a disconnected dentry
  * @dentry: a negative dentry which we want to point to the inode.
  *
- * If inode is a directory and has a 'disconnected' dentry (i.e. IS_ROOT and
- * DCACHE_DISCONNECTED), then d_move that in place of the given dentry
- * and return it, else simply d_add the inode to the dentry and return NULL.
+ * If inode is a directory and has an IS_ROOT alias, then d_move that in
+ * place of the given dentry and return it, else simply d_add the inode
+ * to the dentry and return NULL.
  *
  * If a non-IS_ROOT directory is found, the filesystem is corrupt, and
  * we should error out: directories can't have multiple aliases.
@@ -2615,7 +2615,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
 		spin_lock(&inode->i_lock);
 		new = __d_find_any_alias(inode);
 		if (new) {
-			if (!IS_ROOT(new) || !(new->d_flags & DCACHE_DISCONNECTED)) {
+			if (!IS_ROOT(new)) {
 				spin_unlock(&inode->i_lock);
 				dput(new);
 				return ERR_PTR(-EIO);
-- 
1.7.9.5


  parent reply	other threads:[~2014-06-04 21:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 21:20 [PATCH 00/11] mainly d_splice_alias fixes J. Bruce Fields
2014-06-04 21:20 ` [PATCH 01/11] namei: trivial fix to vfs_rename_dir comment J. Bruce Fields
2014-06-04 21:20 ` [PATCH 02/11] dcache: move d_splice_alias J. Bruce Fields
2014-06-04 21:20 ` [PATCH 03/11] dcache: close d_move race in d_splice_alias J. Bruce Fields
2014-06-04 21:20 ` [PATCH 04/11] dcache: d_splice_alias mustn't create directory aliases J. Bruce Fields
2014-06-04 21:20 ` J. Bruce Fields [this message]
2014-06-04 21:20 ` [PATCH 06/11] dcache: d_obtain_alias callers don't all want DISCONNECTED J. Bruce Fields
2014-06-04 21:20 ` [PATCH 07/11] dcache: remove unused d_find_alias parameter J. Bruce Fields
2014-06-04 21:21 ` [PATCH 08/11] dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED J. Bruce Fields
2014-06-04 21:21 ` [PATCH 09/11] exportfs: update Exporting documentation J. Bruce Fields
2014-06-04 21:54   ` Bernd Schubert
2014-06-06 21:23     ` J. Bruce Fields
2014-06-05 12:51   ` Marc Dionne
2014-06-06 21:20     ` J. Bruce Fields
2014-06-04 21:21 ` [PATCH 10/11] dcache: d_materialise_unique isn't GPL-only J. Bruce Fields
2014-06-04 21:21 ` [PATCH 11/11] dcache: d_splice_alias should detect loops J. Bruce Fields

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=1401916863-7916-6-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.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;
as well as URLs for NNTP newsgroup(s).