浏览代码

pNFS/files: filelayout_write_done_cb must call nfs_writeback_update_inode()

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>
Trond Myklebust 9 年之前
父节点
当前提交
e033fb51eb
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      fs/nfs/filelayout/filelayout.c

+ 6 - 0
fs/nfs/filelayout/filelayout.c

@@ -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;
 }