diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-09-30 15:13:17 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:19:11 -0400 |
commit | b64e8a5ef758888cb42b7c105dcfaaf51aab1baf (patch) | |
tree | a8555028da59911132f4677ddabc73f4b88dc41c /fs/nfs | |
parent | 7fdc49c4e49ba926348f71844cda7f5e12709738 (diff) |
NFS: Remove bogus check of cache_change_attribute in nfs_update_inode
Remove the bogus 'data_stable' check in nfs_update_inode. The
cache_change_attribute tells you if the directory changed on the server,
and should have nothing to do with the file length.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 185cfd09d7f7..23feb9e3d8b0 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -942,7 +942,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
942 | loff_t cur_isize, new_isize; | 942 | loff_t cur_isize, new_isize; |
943 | unsigned int invalid = 0; | 943 | unsigned int invalid = 0; |
944 | unsigned long now = jiffies; | 944 | unsigned long now = jiffies; |
945 | int data_stable; | ||
946 | 945 | ||
947 | dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n", | 946 | dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n", |
948 | __FUNCTION__, inode->i_sb->s_id, inode->i_ino, | 947 | __FUNCTION__, inode->i_sb->s_id, inode->i_ino, |
@@ -969,8 +968,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
969 | nfsi->read_cache_jiffies = fattr->time_start; | 968 | nfsi->read_cache_jiffies = fattr->time_start; |
970 | nfsi->last_updated = now; | 969 | nfsi->last_updated = now; |
971 | 970 | ||
972 | /* Are we racing with known updates of the metadata on the server? */ | ||
973 | data_stable = nfs_verify_change_attribute(inode, fattr->time_start); | ||
974 | nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ATIME | 971 | nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ATIME |
975 | | NFS_INO_REVAL_PAGECACHE); | 972 | | NFS_INO_REVAL_PAGECACHE); |
976 | 973 | ||
@@ -1002,15 +999,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1002 | new_isize = nfs_size_to_loff_t(fattr->size); | 999 | new_isize = nfs_size_to_loff_t(fattr->size); |
1003 | cur_isize = i_size_read(inode); | 1000 | cur_isize = i_size_read(inode); |
1004 | if (new_isize != cur_isize) { | 1001 | if (new_isize != cur_isize) { |
1005 | /* Do we perhaps have any outstanding writes? */ | 1002 | /* Do we perhaps have any outstanding writes, or has |
1006 | if (nfsi->npages == 0) { | 1003 | * the file grown beyond our last write? */ |
1007 | /* No, but did we race with nfs_end_data_update()? */ | 1004 | if (nfsi->npages == 0 || new_isize > cur_isize) { |
1008 | if (data_stable) { | ||
1009 | inode->i_size = new_isize; | ||
1010 | invalid |= NFS_INO_INVALID_DATA; | ||
1011 | } | ||
1012 | invalid |= NFS_INO_INVALID_ATTR; | ||
1013 | } else if (new_isize > cur_isize) { | ||
1014 | inode->i_size = new_isize; | 1005 | inode->i_size = new_isize; |
1015 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; | 1006 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; |
1016 | } | 1007 | } |