diff options
Diffstat (limited to 'fs/nfs/inode.c')
| -rw-r--r-- | fs/nfs/inode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index af53c02f473b..44aa9b726573 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -341,8 +341,10 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 341 | lock_kernel(); | 341 | lock_kernel(); |
| 342 | nfs_begin_data_update(inode); | 342 | nfs_begin_data_update(inode); |
| 343 | /* Write all dirty data */ | 343 | /* Write all dirty data */ |
| 344 | filemap_write_and_wait(inode->i_mapping); | 344 | if (S_ISREG(inode->i_mode)) { |
| 345 | nfs_wb_all(inode); | 345 | filemap_write_and_wait(inode->i_mapping); |
| 346 | nfs_wb_all(inode); | ||
| 347 | } | ||
| 346 | /* | 348 | /* |
| 347 | * Return any delegations if we're going to change ACLs | 349 | * Return any delegations if we're going to change ACLs |
| 348 | */ | 350 | */ |
| @@ -429,7 +431,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
| 429 | int err; | 431 | int err; |
| 430 | 432 | ||
| 431 | /* Flush out writes to the server in order to update c/mtime */ | 433 | /* Flush out writes to the server in order to update c/mtime */ |
| 432 | nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT); | 434 | if (S_ISREG(inode->i_mode)) |
| 435 | nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT); | ||
| 433 | 436 | ||
| 434 | /* | 437 | /* |
| 435 | * We may force a getattr if the user cares about atime. | 438 | * We may force a getattr if the user cares about atime. |
