From: Jens Axboe Date: Wed, 3 May 2006 08:58:22 +0000 (+0200) Subject: [PATCH] splice: redo page lookup if add_to_page_cache() returns -EEXIST X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a0548871ed267ae12eb1c860c5aaebd9e466b34e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- diff --git a/fs/splice.c b/fs/splice.c index 8fa9217ed585..a285fd746dc0 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -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; } /*