]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Add attribute update barriers to nfs_setattr_update_inode()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 26 Feb 2015 21:09:04 +0000 (16:09 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 2 Mar 2015 04:23:05 +0000 (23:23 -0500)
commit404c4df6583d9b9fb086c9d3801094917c1f9f9f
tree7fbfe0ffc4f5a5b3f9ccf56de8fe887c7394027c
parentc28e716d4154443552d1fb69b3f7b79c414e159c
NFS: Add attribute update barriers to nfs_setattr_update_inode()

Ensure that other operations which raced with our setattr RPC call
cannot revert the file attribute changes that were made on the server.
To do so, we artificially bump the attribute generation counter on
the inode so that all calls to nfs_fattr_init() that precede ours
will be dropped.

The motivation for the patch came from Chuck Lever's reports of readaheads
racing with truncate operations and causing the file size to be reverted.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfs/inode.c
fs/nfs/nfs3proc.c
fs/nfs/nfs4proc.c
fs/nfs/proc.c
include/linux/nfs_fs.h