Commit 1f02f151 authored by Trond Myklebust's avatar Trond Myklebust

Subject: [PATCH] NFS: better handling of short writes in direct write path

 Immediately return control to the application if a short NFS write is
 detected in the NFS client's direct write path.  This is better behavior
 than what the direct write path does today, which could result in data
 appearing at the wrong offset in the file.

 Eventually this code path should retry short writes at least once before
 giving up.
Signed-off-by: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent a3056ac5
......@@ -310,7 +310,12 @@ nfs_direct_write_seg(struct inode *inode, struct nfs_open_context *ctx,
goto sync_retry;
}
tot_bytes += result;
tot_bytes += result;
/* in case of a short write: stop now, let the app recover */
if (result < wdata.args.count)
break;
wdata.args.offset += result;
wdata.args.pgbase += result;
curpage += wdata.args.pgbase >> PAGE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment