Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0548871 authored by Jens Axboe's avatar Jens Axboe Committed by Jens Axboe
Browse files

[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: default avatarJens Axboe <axboe@suse.de>
parent 76ad4d11
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
			}
			/*