Skip to content

Commit

Permalink
[PATCH] splice: redo page lookup if add_to_page_cache() returns -EEXIST
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed May 4, 2006
1 parent 76ad4d1 commit a054887
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
mapping_gfp_mask(mapping));
if (unlikely(error)) {
page_cache_release(page);
if (error == -EEXIST)
continue;
break;
}
/*
Expand Down

0 comments on commit a054887

Please sign in to comment.