diff options
author | Jens Axboe <axboe@suse.de> | 2006-05-03 04:58:22 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-05-04 00:55:12 -0400 |
commit | a0548871ed267ae12eb1c860c5aaebd9e466b34e (patch) | |
tree | 457aff209cd9a2a1c3c2678b639268dfa482f3d1 /fs | |
parent | 76ad4d11105ccd40a536db1057083f28326019fd (diff) |
[PATCH] splice: redo page lookup if add_to_page_cache() returns -EEXIST
This can happen quite easily, if several processes are trying to splice
the same file at the same time. It's not a failure, it just means someone
raced with us in allocating this file page. So just dump the allocated
page and relookup the original.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/splice.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/splice.c b/fs/splice.c index 8fa9217ed58..a285fd746dc 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -324,6 +324,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
324 | mapping_gfp_mask(mapping)); | 324 | mapping_gfp_mask(mapping)); |
325 | if (unlikely(error)) { | 325 | if (unlikely(error)) { |
326 | page_cache_release(page); | 326 | page_cache_release(page); |
327 | if (error == -EEXIST) | ||
328 | continue; | ||
327 | break; | 329 | break; |
328 | } | 330 | } |
329 | /* | 331 | /* |