mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
[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>
This commit is contained in:
parent
76ad4d1110
commit
a0548871ed
1 changed files with 2 additions and 0 deletions
|
@ -324,6 +324,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
|
||||||
mapping_gfp_mask(mapping));
|
mapping_gfp_mask(mapping));
|
||||||
if (unlikely(error)) {
|
if (unlikely(error)) {
|
||||||
page_cache_release(page);
|
page_cache_release(page);
|
||||||
|
if (error == -EEXIST)
|
||||||
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue