aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-26 17:57:14 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-03-01 23:23:06 -0500
commit00fb4c9f8421c9aac3947d36ffe8e049b95f7ab1 (patch)
tree22710794d5c32ae8a18f8822741dbd8e13c0e04b /fs/nfs
parent8f8ba1d739b7047e2e1d91735716af2799ff2b1e (diff)
NFS: Remove size hack in nfs_inode_attrs_need_update()
Prior to this patch, we used to always OK attribute updates that extended the file size on the assumption that we might be performing writeback. Now that we have attribute barriers to protect the writeback related updates, we should remove this hack, as it can cause truncate() operations to apparently be reverted if/when a readahead or getattr RPC call races with our on-the-wire SETATTR. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index cd094d652199..fef65d1e024e 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1238,13 +1238,6 @@ static int nfs_ctime_need_update(const struct inode *inode, const struct nfs_fat
1238 return timespec_compare(&fattr->ctime, &inode->i_ctime) > 0; 1238 return timespec_compare(&fattr->ctime, &inode->i_ctime) > 0;
1239} 1239}
1240 1240
1241static int nfs_size_need_update(const struct inode *inode, const struct nfs_fattr *fattr)
1242{
1243 if (!(fattr->valid & NFS_ATTR_FATTR_SIZE))
1244 return 0;
1245 return nfs_size_to_loff_t(fattr->size) > i_size_read(inode);
1246}
1247
1248static atomic_long_t nfs_attr_generation_counter; 1241static atomic_long_t nfs_attr_generation_counter;
1249 1242
1250static unsigned long nfs_read_attr_generation_counter(void) 1243static unsigned long nfs_read_attr_generation_counter(void)
@@ -1393,7 +1386,6 @@ static int nfs_inode_attrs_need_update(const struct inode *inode, const struct n
1393 1386
1394 return ((long)fattr->gencount - (long)nfsi->attr_gencount) > 0 || 1387 return ((long)fattr->gencount - (long)nfsi->attr_gencount) > 0 ||
1395 nfs_ctime_need_update(inode, fattr) || 1388 nfs_ctime_need_update(inode, fattr) ||
1396 nfs_size_need_update(inode, fattr) ||
1397 ((long)nfsi->attr_gencount - (long)nfs_read_attr_generation_counter() > 0); 1389 ((long)nfsi->attr_gencount - (long)nfs_read_attr_generation_counter() > 0);
1398} 1390}
1399 1391