]> err.no Git - linux-2.6/commitdiff
NFS: nfs_post_op_update_inode() should call nfs_refresh_inode()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 15 Aug 2007 16:59:12 +0000 (12:59 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:18:43 +0000 (17:18 -0400)
Ensure that we don't clobber the results from a more recent getattr call...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/inode.c

index 721e511f8ba9896523ac8682c025b9dc83ceca11..0d98074d07668b6266aad3300d8a53677ec96d59 100644 (file)
@@ -915,14 +915,14 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr)
        struct nfs_inode *nfsi = NFS_I(inode);
        int status = 0;
 
-       spin_lock(&inode->i_lock);
        if (unlikely((fattr->valid & NFS_ATTR_FATTR) == 0)) {
+               spin_lock(&inode->i_lock);
                nfsi->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
+               spin_unlock(&inode->i_lock);
                goto out;
        }
-       status = nfs_update_inode(inode, fattr);
+       status = nfs_refresh_inode(inode, fattr);
 out:
-       spin_unlock(&inode->i_lock);
        return status;
 }