NFS: File unlock needs to be a metadata synchronisation point
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 26 Mar 2015 19:55:49 +0000 (15:55 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 27 Mar 2015 16:39:37 +0000 (12:39 -0400)
File unlock needs to update both data and metadata on the NFS server
in order to act as a synchronisation point for other clients.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/file.c

index e679d24..6959cb7 100644 (file)
@@ -780,7 +780,7 @@ do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
         * Flush all pending writes before doing anything
         * with locks..
         */
-       nfs_sync_mapping(filp->f_mapping);
+       vfs_fsync(filp, 0);
 
        l_ctx = nfs_get_lock_context(nfs_file_open_context(filp));
        if (!IS_ERR(l_ctx)) {