|
@@ -1470,6 +1470,7 @@ static void ff_layout_read_release(void *data)
|
|
static int ff_layout_write_done_cb(struct rpc_task *task,
|
|
static int ff_layout_write_done_cb(struct rpc_task *task,
|
|
struct nfs_pgio_header *hdr)
|
|
struct nfs_pgio_header *hdr)
|
|
{
|
|
{
|
|
|
|
+ loff_t end_offs = 0;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
trace_nfs4_pnfs_write(hdr, task->tk_status);
|
|
trace_nfs4_pnfs_write(hdr, task->tk_status);
|
|
@@ -1495,8 +1496,10 @@ static int ff_layout_write_done_cb(struct rpc_task *task,
|
|
|
|
|
|
if (hdr->res.verf->committed == NFS_FILE_SYNC ||
|
|
if (hdr->res.verf->committed == NFS_FILE_SYNC ||
|
|
hdr->res.verf->committed == NFS_DATA_SYNC)
|
|
hdr->res.verf->committed == NFS_DATA_SYNC)
|
|
- ff_layout_set_layoutcommit(hdr->inode, hdr->lseg,
|
|
|
|
- hdr->mds_offset + (loff_t)hdr->res.count);
|
|
|
|
|
|
+ end_offs = hdr->mds_offset + (loff_t)hdr->res.count;
|
|
|
|
+
|
|
|
|
+ /* Note: if the write is unstable, don't set end_offs until commit */
|
|
|
|
+ ff_layout_set_layoutcommit(hdr->inode, hdr->lseg, end_offs);
|
|
|
|
|
|
/* zero out fattr since we don't care DS attr at all */
|
|
/* zero out fattr since we don't care DS attr at all */
|
|
hdr->fattr.valid = 0;
|
|
hdr->fattr.valid = 0;
|