]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
NFS: Ensure we immediately start writeback on rescheduled writes
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 5 Jul 2018 01:01:16 +0000 (21:01 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 26 Jul 2018 20:25:25 +0000 (16:25 -0400)
If the writes are being rescheduled due to a pNFS error, then we really
want to immediately start a new flush. The O_DIRECT code already does
this, so we only need to worry about buffered writes.

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

index a057b4f45a468dd695202f5462787cfd8d2dc0fa..586726a590d88149fa0fe769de37fa7aa14033a2 100644 (file)
@@ -1406,6 +1406,8 @@ static void nfs_async_write_error(struct list_head *head)
 static void nfs_async_write_reschedule_io(struct nfs_pgio_header *hdr)
 {
        nfs_async_write_error(&hdr->pages);
+       filemap_fdatawrite_range(hdr->inode->i_mapping, hdr->args.offset,
+                       hdr->args.offset + hdr->args.count - 1);
 }
 
 static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops = {