remarkable-linux/fs/nfs
Andreas Gruenbacher b8a7a3a667 posix_acl: Inode acl caching fixes
When get_acl() is called for an inode whose ACL is not cached yet, the
get_acl inode operation is called to fetch the ACL from the filesystem.
The inode operation is responsible for updating the cached acl with
set_cached_acl().  This is done without locking at the VFS level, so
another task can call set_cached_acl() or forget_cached_acl() before the
get_acl inode operation gets to calling set_cached_acl(), and then
get_acl's call to set_cached_acl() results in caching an outdate ACL.

Prevent this from happening by setting the cached ACL pointer to a
task-specific sentinel value before calling the get_acl inode operation.
Move the responsibility for updating the cached ACL from the get_acl
inode operations to get_acl().  There, only set the cached ACL if the
sentinel value hasn't changed.

The sentinel values are chosen to have odd values.  Likewise, the value
of ACL_NOT_CACHED is odd.  In contrast, ACL object pointers always have
an even value (ACLs are aligned in memory).  This allows to distinguish
uncached ACLs values from ACL objects.

In addition, switch from guarding inode->i_acl and inode->i_default_acl
upates by the inode->i_lock spinlock to using xchg() and cmpxchg().

Filesystems that do not want ACLs returned from their get_acl inode
operations to be cached must call forget_cached_acl() to prevent the VFS
from doing so.

(Patch written by Al Viro and Andreas Gruenbacher.)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2016-03-31 00:30:15 -04:00
..
blocklayout Various bugfixes, a RDMA update from Chuck Lever, and support for a new 2016-03-24 19:50:32 -07:00
filelayout NFS: Simplify nfs_request_add_commit_list() arguments 2016-01-21 15:54:04 -05:00
flexfilelayout nfs4: nfs4_ff_layout_prepare_ds should return NULL if connection failed 2016-03-16 15:46:48 -04:00
objlayout osd fs: __r4w_get_page rely on PageUptodate for uptodate 2015-12-12 10:15:34 -08:00
cache_lib.c
cache_lib.h
callback.c NFS: Enable client side NFSv4.1 backchannel to use other transports 2015-11-02 16:29:13 -05:00
callback.h NFSv4.x: Allow multiple callbacks in flight 2016-01-25 09:36:21 -05:00
callback_proc.c NFSv4.x: Fix NFS4ERR_RETRY_UNCACHED_REP in nfs4_callback_sequence 2016-02-01 12:06:24 -05:00
callback_xdr.c NFSv4.x: Allow multiple callbacks in flight 2016-01-25 09:36:21 -05:00
client.c nfs: get clone_blksize when probing fsinfo 2015-10-15 16:08:18 -04:00
delegation.c NFSv4: Don't use synchronous delegation recall in exception handling 2015-10-08 10:45:53 -04:00
delegation.h NFSv4: Recovery of recalled read delegations is broken 2015-09-20 22:34:16 -04:00
dir.c nfs_lookup: don't bother with d_instantiate(dentry, NULL) 2016-03-14 00:16:40 -04:00
direct.c wrappers for ->i_mutex access 2016-01-22 18:04:28 -05:00
dns_resolve.c
dns_resolve.h
file.c nfs: remove nfs_inode_dio_wait 2016-03-16 15:42:43 -04:00
fscache-index.c
fscache.c
fscache.h
getroot.c
inode.c nfs: remove nfs_inode_dio_wait 2016-03-16 15:42:43 -04:00
internal.h nfs: remove nfs_inode_dio_wait 2016-03-16 15:42:43 -04:00
iostat.h
Kconfig
Makefile
mount_clnt.c NFS: Remove unneeded NFS_DEBUG checking before define NFSDBG_FACILITY 2015-10-21 15:49:23 -05:00
namespace.c
netns.h
nfs.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h
nfs3acl.c posix_acl: Inode acl caching fixes 2016-03-31 00:30:15 -04:00
nfs3client.c
nfs3proc.c
nfs3super.c
nfs3xdr.c
nfs4_fs.h NFSv4: Refactor NFSv4 error handling 2015-10-08 10:45:51 -04:00
nfs4client.c nfs4: start callback_ident at idr 1 2015-11-23 21:59:42 -05:00
nfs4file.c nfs: remove nfs4_file_fsync 2016-03-16 15:42:43 -04:00
nfs4getroot.c
nfs4idmap.c KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
nfs4idmap.h
nfs4namespace.c
nfs4proc.c NFS client updates for Linux 4.6 2016-03-22 13:16:21 -07:00
nfs4renewd.c
nfs4session.c NFSv4.x: Allow multiple callbacks in flight 2016-01-25 09:36:21 -05:00
nfs4session.h NFSv4.x: Allow multiple callbacks in flight 2016-01-25 09:36:21 -05:00
nfs4state.c NFSv4: Don't try to reclaim unused state owners 2015-10-02 15:43:07 -04:00
nfs4super.c
nfs4sysctl.c nfs: do not initialise statics to 0 2015-12-28 09:57:15 -05:00
nfs4trace.c pNFS: Modify pnfs_update_layout tracepoints to use layout stateid 2015-12-28 09:57:14 -05:00
nfs4trace.h Merge branch 'bugfixes' 2016-01-07 18:45:36 -05:00
nfs4xdr.c NFS4: Cleanup FATTR4_WORD0_FS_LOCATIONS after decoding success 2015-11-23 21:56:53 -05:00
nfs42.h nfs42: add CLONE proc functions 2015-10-15 16:07:36 -04:00
nfs42proc.c nfs4: fix stateid handling for the NFS v4.2 operations 2016-02-17 11:38:07 -05:00
nfs42xdr.c nfs42: add CLONE xdr functions 2015-10-15 16:07:21 -04:00
nfsroot.c nfsroot: make nfsroot to accept the 1024 bytes long directory name 2015-10-21 15:49:19 -05:00
nfstrace.c
nfstrace.h NFS: Allow multiple commit requests in flight per file 2015-12-31 13:53:48 -05:00
pagelist.c NFS: Fix a compile warning about unused variable in nfs_generic_pg_pgios() 2016-01-08 08:12:47 -05:00
pnfs.c NFSv4.x/pnfs: Fix a race between layoutget and bulk recalls 2016-02-22 17:46:34 -05:00
pnfs.h NFS: Cleanup - rename NFS_LAYOUT_RETURN_BEFORE_CLOSE 2016-01-27 20:40:05 -05:00
pnfs_dev.c
pnfs_nfs.c pnfs/NFSv4.1: Add multipath capabilities to pNFS flexfiles servers over NFSv3 2016-02-05 18:48:57 -05:00
proc.c
read.c nfs: handle request add failure properly 2015-12-28 14:32:37 -05:00
super.c NFS: Remove the left global variable nfs_callback_tcpport 2015-10-21 15:49:22 -05:00
symlink.c switch ->get_link() to delayed_call, kill ->put_link() 2015-12-30 13:01:03 -05:00
sysctl.c
unlink.c
write.c NFS: Simplify nfs_request_add_commit_list() arguments 2016-01-21 15:54:04 -05:00