Skip to content

Commit

Permalink
splice: fix problem with atime not being updated
Browse files Browse the repository at this point in the history
A bug report on nfsd that states that since it was switched to use
splice instead of sendfile, the atime was no longer being updated
on the input file. do_generic_mapping_read() does this when accessing
the file, make splice do it for the direct splice handler.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Jan 29, 2008
1 parent 12f32bb commit 9e97198
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
goto out_release;
}

done:
pipe->nrbufs = pipe->curbuf = 0;
if (bytes > 0)
file_accessed(in);

return bytes;

out_release:
Expand All @@ -1047,16 +1051,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
buf->ops = NULL;
}
}
pipe->nrbufs = pipe->curbuf = 0;

/*
* If we transferred some data, return the number of bytes:
*/
if (bytes > 0)
return bytes;

return ret;
if (!bytes)
bytes = ret;

goto done;
}
EXPORT_SYMBOL(splice_direct_to_actor);

Expand Down

0 comments on commit 9e97198

Please sign in to comment.