linux/fs/nfs
Anna Schumaker ea96d1ecbe nfs: Fetch MOUNTED_ON_FILEID when updating an inode
2ef47eb1 (NFS: Fix use of nfs_attr_use_mounted_on_fileid()) was a good
start to fixing a circular directory structure warning for NFS v4
"junctioned" mountpoints.  Unfortunately, further testing continued to
generate this error.

My server is configured like this:

anna@nfsd ~ % df
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       9.1G  2.0G  6.5G  24% /
/dev/vdc1      1014M   33M  982M   4% /exports
/dev/vdc2      1014M   33M  982M   4% /exports/vol1
/dev/vdc3      1014M   33M  982M   4% /exports/vol1/vol2

anna@nfsd ~ % cat /etc/exports
/exports/          *(rw,async,no_subtree_check,no_root_squash)
/exports/vol1/     *(rw,async,no_subtree_check,no_root_squash)
/exports/vol1/vol2 *(rw,async,no_subtree_check,no_root_squash)

I've been running chown across the entire mountpoint twice in a row to
hit this problem.  The first run succeeds, but the second one fails with
the circular directory warning along with:

anna@client ~ % dmesg
[Apr 3 14:28] NFS: server 192.168.100.204 error: fileid changed
              fsid 0:39: expected fileid 0x100080, got 0x80

WHere 0x80 is the mountpoint's fileid and 0x100080 is the mounted-on
fileid.

This patch fixes the issue by requesting an updated mounted-on fileid
from the server during nfs_update_inode(), and then checking that the
fileid stored in the nfs_inode matches either the fileid or mounted-on
fileid returned by the server.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-04-23 14:43:54 -04:00
..
blocklayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
filelayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
flexfilelayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
objlayout NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
cache_lib.c
cache_lib.h
callback_proc.c NFSv4.1: Don't set up a backchannel if the server didn't agree to do so 2015-02-18 12:30:47 -08:00
callback_xdr.c NFSv4.1: Convert open-coded array allocation calls to kmalloc_array() 2015-02-11 19:02:52 -05:00
callback.c nfs: fix high load average due to callback thread sleeping 2015-04-23 14:38:07 -04:00
callback.h
client.c NFSv4: Fix a race in NFSv4.1 server trunking discovery 2015-03-03 20:42:23 -05:00
delegation.c NFSv4: Append delegations to the per-client list instead of prepending 2015-03-12 12:13:56 -04:00
delegation.h
dir.c NFS: Don't require a filehandle to refresh the inode in nfs_prime_dcache() 2015-03-01 23:23:07 -05:00
direct.c NFSv4.1/pnfs: Ensure that writes respect the O_SYNC flag when doing O_DIRECT 2015-03-27 12:39:37 -04:00
dns_resolve.c
dns_resolve.h
file.c NFSv4.1/pnfs: Ensure that writes respect the O_SYNC flag when doing O_DIRECT 2015-03-27 12:39:37 -04:00
fscache-index.c
fscache.c nfs: define nfs_inc_fscache_stats and using it as possible 2014-11-24 20:08:47 -05:00
fscache.h
getroot.c
idmap.c pnfs/flexfiles: Add the FlexFile Layout Driver 2015-02-03 11:06:52 -08:00
inode.c nfs: Fetch MOUNTED_ON_FILEID when updating an inode 2015-04-23 14:43:54 -04:00
internal.h NFS: Add attribute update barriers to NFS writebacks 2015-03-01 23:23:06 -05:00
iostat.h nfs: define nfs_inc_fscache_stats and using it as possible 2014-11-24 20:08:47 -05:00
Kconfig pnfs/flexfiles: Add the FlexFile Layout Driver 2015-02-03 11:06:52 -08:00
Makefile pnfs/flexfiles: Add the FlexFile Layout Driver 2015-02-03 11:06:52 -08:00
mount_clnt.c
namespace.c
netns.h
nfs.h
nfs2super.c
nfs2xdr.c nfs: save server READ/WRITE/COMMIT status 2015-02-03 11:06:40 -08:00
nfs3_fs.h nfsv3: introduce nfs3_set_ds_client 2015-02-03 11:06:34 -08:00
nfs3acl.c
nfs3client.c nfs: set hostname when creating nfsv3 ds connection 2015-02-03 11:06:38 -08:00
nfs3proc.c NFS: Add attribute update barriers to NFS writebacks 2015-03-01 23:23:06 -05:00
nfs3super.c nfsv3: introduce nfs3_set_ds_client 2015-02-03 11:06:34 -08:00
nfs3xdr.c NFSv3: Use the readdir fileid as the mounted-on-fileid 2015-03-01 23:23:07 -05:00
nfs4_fs.h Merge branch 'flexfiles' 2015-02-03 16:01:27 -05:00
nfs4client.c NFSv4: Fix a race in NFSv4.1 server trunking discovery 2015-03-03 20:42:23 -05:00
nfs4file.c NFS: Reduce time spent holding the i_mutex during fallocate() 2015-04-23 14:36:28 -04:00
nfs4getroot.c
nfs4namespace.c
nfs4proc.c nfs: Fetch MOUNTED_ON_FILEID when updating an inode 2015-04-23 14:43:54 -04:00
nfs4renewd.c
nfs4session.c NFSv4.1: Don't set up a backchannel if the server didn't agree to do so 2015-02-18 12:30:47 -08:00
nfs4session.h NFSv4.1: Clear the old state by our client id before establishing a new lease 2015-03-03 21:52:30 -05:00
nfs4state.c NFSv4.1: Clear the old state by our client id before establishing a new lease 2015-03-03 21:52:30 -05:00
nfs4super.c NFSv4: Return the delegation before returning the layout in evict_inode() 2015-03-27 12:39:35 -04:00
nfs4sysctl.c
nfs4trace.c
nfs4trace.h
nfs4xdr.c NFSv4.1: Allow getdeviceinfo to return notification info back to caller 2015-03-27 12:32:24 -04:00
nfs42.h nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfs42proc.c NFS: Reduce time spent holding the i_mutex during fallocate() 2015-04-23 14:36:28 -04:00
nfs42xdr.c NFS: Don't zap caches on fallocate() 2015-04-23 14:36:28 -04:00
nfsroot.c NFS: a couple off by ones 2015-01-30 20:43:30 -05:00
nfstrace.c NFSv4: Allow tracing of NFSv4 fsync calls 2015-03-27 12:39:34 -04:00
nfstrace.h
pagelist.c NFS client updates for Linux 3.20 2015-02-11 17:14:54 -08:00
pnfs_dev.c NFSv4.1: Don't cache deviceids that have no notifications 2015-03-27 12:32:24 -04:00
pnfs_nfs.c NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
pnfs.c NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
pnfs.h NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00
proc.c NFS: Add attribute update barriers to NFS writebacks 2015-03-01 23:23:06 -05:00
read.c nfs: add mirroring support to pgio layer 2015-02-03 11:06:45 -08:00
super.c Merge branch 'for-3.20/bdi' of git://git.kernel.dk/linux-block 2015-02-12 13:50:21 -08:00
symlink.c
sysctl.c
unlink.c
write.c NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS 2015-03-27 12:39:38 -04:00