WSL2-Linux-Kernel/fs/nfs
Anna Schumaker 2ef47eb1ae NFS: Fix use of nfs_attr_use_mounted_on_fileid()
This function call was being optimized out during nfs_fhget(), leading
to situations where we have a valid fileid but still want to use the
mounted_on_fileid.  For example, imagine we have our server configured
like this:

server % df
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       9.1G  6.5G  1.9G  78% /
/dev/vdb1       487M  2.3M  456M   1% /exports
/dev/vdc1       487M  2.3M  456M   1% /exports/vol1
/dev/vdd1       487M  2.3M  456M   1% /exports/vol2

If our client mounts /exports and tries to do a "chown -R" across the
entire mountpoint, we will get a nasty message warning us about a circular
directory structure.  Running chown with strace tells me that each directory
has the same device and inode number:

newfstatat(AT_FDCWD, "/nfs/", {st_dev=makedev(0, 38), st_ino=2, ...}) = 0
newfstatat(4, "vol1", {st_dev=makedev(0, 38), st_ino=2, ...}) = 0
newfstatat(4, "vol2", {st_dev=makedev(0, 38), st_ino=2, ...}) = 0

With this patch the mounted_on_fileid values are used for st_ino, so the
directory loop warning isn't reported.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-01-21 17:15:41 -05:00
..
blocklayout Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-12-10 16:10:49 -08:00
filelayout NFS: Deletion of unnecessary checks before the function call "nfs_put_client" 2014-11-24 20:07:27 -05:00
objlayout Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd 2014-10-21 12:53:45 -07:00
Kconfig
Makefile NFS: Implement SEEK 2014-09-30 16:24:56 -04:00
cache_lib.c
cache_lib.h
callback.c nfs: do not start the callback thread until we set rqstp->rq_task 2014-09-02 17:53:30 -04:00
callback.h
callback_proc.c NFS: fix subtle change in COMMIT behavior 2014-11-24 17:00:42 -05:00
callback_xdr.c
client.c Merge branch 'bugfixes' into linux-next 2014-09-30 17:21:41 -04:00
delegation.c NFS: Don't try to reclaim delegation open state if recovery failed 2014-11-12 17:19:04 -05:00
delegation.h NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return 2014-11-12 17:19:04 -05:00
dir.c Merge branch 'iov_iter' into for-next 2014-12-08 20:39:29 -05:00
direct.c nfs: fix dio deadlock when O_DIRECT flag is flipped 2015-01-21 17:10:08 -05:00
dns_resolve.c
dns_resolve.h
file.c Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block 2014-10-18 11:53:51 -07:00
fscache-index.c NFS: Fabricate fscache server index key correctly 2014-09-25 21:25:18 -04:00
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 switch d_materialise_unique() users to d_splice_alias() 2014-11-19 13:01:20 -05:00
idmap.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
inode.c NFS: Fix use of nfs_attr_use_mounted_on_fileid() 2015-01-21 17:15:41 -05:00
internal.h NFS: Fix use of nfs_attr_use_mounted_on_fileid() 2015-01-21 17:15:41 -05:00
iostat.h nfs: define nfs_inc_fscache_stats and using it as possible 2014-11-24 20:08:47 -05:00
mount_clnt.c
namespace.c
netns.h pnfs/blocklayout: serialize GETDEVICEINFO calls 2014-11-12 14:22:52 -05:00
nfs.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h NFS: Move NFS v3 acl functions to nfs3_fs.h 2014-09-12 13:50:26 -04:00
nfs3acl.c NFSv3: Fix missing includes of nfs3_fs.h 2014-09-25 16:28:53 -04:00
nfs3client.c NFSv3: Fix missing includes of nfs3_fs.h 2014-09-25 16:28:53 -04:00
nfs3proc.c NFS: Move v3 declarations out of internal.h 2014-09-12 13:49:40 -04:00
nfs3super.c NFS: Move NFS v3 acl functions to nfs3_fs.h 2014-09-12 13:50:26 -04:00
nfs3xdr.c
nfs4_fs.h nfs: Add ALLOCATE support 2014-11-25 16:38:32 -05:00
nfs4client.c NFSv4.1: Fix an Oops in nfs41_walk_client_list 2015-01-21 17:10:09 -05:00
nfs4file.c nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfs4getroot.c
nfs4namespace.c
nfs4proc.c NFSv4: Remove incorrect check in can_open_delegated() 2015-01-05 19:40:54 -08:00
nfs4renewd.c NFSv4.1: Fix an NFSv4.1 state renewal regression 2014-09-30 17:18:42 -04:00
nfs4session.c
nfs4session.h
nfs4state.c Merge branch 'bugfixes' into linux-next 2014-09-30 17:21:41 -04:00
nfs4super.c
nfs4sysctl.c
nfs4trace.c
nfs4trace.h
nfs4xdr.c NFS: Generic client side changes from Chuck 2014-11-26 17:34:14 -05:00
nfs42.h nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfs42proc.c nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfs42xdr.c nfs: Add DEALLOCATE support 2014-11-25 16:38:32 -05:00
nfsroot.c
nfstrace.c
nfstrace.h
pagelist.c NFS: fix subtle change in COMMIT behavior 2014-11-24 17:00:42 -05:00
pnfs.c NFSv4.1/pnfs: replace broken pnfs_put_lseg_async 2014-10-08 16:45:43 -04:00
pnfs.h NFSv4.1/pnfs: replace broken pnfs_put_lseg_async 2014-10-08 16:45:43 -04:00
pnfs_dev.c pnfs: remove GETDEVICELIST implementation 2014-09-12 13:20:54 -04:00
proc.c
read.c nfs: replace nfs_add_stats with nfs_inc_stats when add one 2014-11-24 20:08:47 -05:00
super.c NFS: Remove v3 not compiled check from validate_mount_data() 2014-09-12 13:50:20 -04:00
symlink.c
sysctl.c
unlink.c
write.c nfs: replace nfs_add_stats with nfs_inc_stats when add one 2014-11-24 20:08:47 -05:00