|
@@ -1214,6 +1214,11 @@ static bool nfs_file_has_writers(struct nfs_inode *nfsi)
|
|
list)->mode & FMODE_WRITE) == FMODE_WRITE;
|
|
list)->mode & FMODE_WRITE) == FMODE_WRITE;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static bool nfs_file_has_buffered_writers(struct nfs_inode *nfsi)
|
|
|
|
+{
|
|
|
|
+ return nfs_file_has_writers(nfsi) && nfs_file_io_is_buffered(nfsi);
|
|
|
|
+}
|
|
|
|
+
|
|
static unsigned long nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|
static unsigned long nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|
{
|
|
{
|
|
struct nfs_inode *nfsi = NFS_I(inode);
|
|
struct nfs_inode *nfsi = NFS_I(inode);
|
|
@@ -1278,7 +1283,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
|
|
if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT))
|
|
if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT))
|
|
return -EIO;
|
|
return -EIO;
|
|
|
|
|
|
- if (!nfs_file_has_writers(nfsi)) {
|
|
|
|
|
|
+ if (!nfs_file_has_buffered_writers(nfsi)) {
|
|
/* Verify a few of the more important attributes */
|
|
/* Verify a few of the more important attributes */
|
|
if ((fattr->valid & NFS_ATTR_FATTR_CHANGE) != 0 && inode->i_version != fattr->change_attr)
|
|
if ((fattr->valid & NFS_ATTR_FATTR_CHANGE) != 0 && inode->i_version != fattr->change_attr)
|
|
invalid |= NFS_INO_INVALID_ATTR | NFS_INO_REVAL_PAGECACHE;
|
|
invalid |= NFS_INO_INVALID_ATTR | NFS_INO_REVAL_PAGECACHE;
|
|
@@ -1660,7 +1665,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|
unsigned long invalid = 0;
|
|
unsigned long invalid = 0;
|
|
unsigned long now = jiffies;
|
|
unsigned long now = jiffies;
|
|
unsigned long save_cache_validity;
|
|
unsigned long save_cache_validity;
|
|
- bool have_writers = nfs_file_has_writers(nfsi);
|
|
|
|
|
|
+ bool have_writers = nfs_file_has_buffered_writers(nfsi);
|
|
bool cache_revalidated = true;
|
|
bool cache_revalidated = true;
|
|
|
|
|
|
dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
|
|
dfprintk(VFS, "NFS: %s(%s/%lu fh_crc=0x%08x ct=%d info=0x%x)\n",
|