All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Cc: Nix <nix@esperi.org.uk>, Neil Brown <neilb@suse.de>
Subject: [PATCH 2/3] NFSv3: Use the readdir fileid as the mounted-on-fileid
Date: Mon, 23 Feb 2015 19:14:56 -0500	[thread overview]
Message-ID: <1424736897-95767-2-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1424736897-95767-1-git-send-email-trond.myklebust@primarydata.com>

When we call readdirplus, set the fileid normally returned by readdir
as the mounted-on-fileid, since that is commonly the case if there is
a mountpoint. To ensure that we get it right, we only set the flag if
the readdir fileid differs from the one returned in the readdirplus
attributes.

This again means that we can avoid the issues described in commit
2ef47eb1aee17 ("NFS: Fix use of nfs_attr_use_mounted_on_fileid()"),
which only fixed NFSv4.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/nfs3xdr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 2a932fdc57cb..53852a4bd88b 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -1987,6 +1987,11 @@ int nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
 		if (entry->fattr->valid & NFS_ATTR_FATTR_V3)
 			entry->d_type = nfs_umode_to_dtype(entry->fattr->mode);
 
+		if (entry->fattr->fileid != entry->ino) {
+			entry->fattr->mounted_on_fileid = entry->ino;
+			entry->fattr->valid |= NFS_ATTR_FATTR_MOUNTED_ON_FILEID;
+		}
+
 		/* In fact, a post_op_fh3: */
 		p = xdr_inline_decode(xdr, 4);
 		if (unlikely(p == NULL))
-- 
2.1.0


  reply	other threads:[~2015-02-24  0:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  0:14 [PATCH 1/3] NFS: Don't invalidate a submounted dentry in nfs_prime_dcache() Trond Myklebust
2015-02-24  0:14 ` Trond Myklebust [this message]
2015-02-24  0:14   ` [PATCH 3/3] NFS: Don't require a filehandle to refresh the inode " Trond Myklebust
2015-02-24 21:53     ` NeilBrown
2015-02-24 21:46   ` [PATCH 2/3] NFSv3: Use the readdir fileid as the mounted-on-fileid NeilBrown
2015-02-24  3:09 ` [PATCH 1/3] NFS: Don't invalidate a submounted dentry in nfs_prime_dcache() Trond Myklebust
2015-02-24 21:49   ` NeilBrown
2015-02-25  0:17     ` Trond Myklebust
2015-02-24 21:44 ` NeilBrown
2015-03-12 23:15 ` Nix

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=1424736897-95767-2-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=nix@esperi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.