|
@@ -744,15 +744,18 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
|
|
|
goto out;
|
|
|
|
|
|
/*
|
|
|
- * Revalidate the cache if the server has time stamps granular
|
|
|
- * enough to detect subsecond changes. Otherwise, clear the
|
|
|
- * cache to prevent missing any changes.
|
|
|
+ * Invalidate cache to prevent missing any changes. If
|
|
|
+ * the file is mapped, clear the page cache as well so
|
|
|
+ * those mappings will be loaded.
|
|
|
*
|
|
|
* This makes locking act as a cache coherency point.
|
|
|
*/
|
|
|
nfs_sync_mapping(filp->f_mapping);
|
|
|
- if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
|
|
|
+ if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ)) {
|
|
|
nfs_zap_caches(inode);
|
|
|
+ if (mapping_mapped(filp->f_mapping))
|
|
|
+ nfs_revalidate_mapping(inode, filp->f_mapping);
|
|
|
+ }
|
|
|
out:
|
|
|
return status;
|
|
|
}
|