pNFS/files: filelayout_write_done_cb must call nfs_writeback_update_inode()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 21 Jul 2016 13:43:43 +0000 (09:43 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 21 Jul 2016 13:46:42 +0000 (09:46 -0400)
All write callbacks are required to call nfs_writeback_update_inode() upon
success to ensure that file size changes are recorded, and the attribute
cache is invalidated.

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

index 25bd91a6e0884f8df879b0bedcceed5f1a6bc37a..a3fc48ba4931d7a25c56077ac114ef279eaa4f3a 100644 (file)
@@ -357,6 +357,12 @@ static int filelayout_write_done_cb(struct rpc_task *task,
        }
 
        filelayout_set_layoutcommit(hdr);
+
+       /* zero out the fattr */
+       hdr->fattr.valid = 0;
+       if (task->tk_status >= 0)
+               nfs_writeback_update_inode(hdr);
+
        return 0;
 }