xfs_file_splice_read: possible circular locking dependency detected
Linus Torvalds
torvalds at linux-foundation.org
Thu Sep 8 21:39:12 CDT 2016
On Thu, Sep 8, 2016 at 7:31 PM, Al Viro <viro at zeniv.linux.org.uk> wrote:
>
> We care because __generic_file_splice_read() is playing fast and loose with
> pagecache. It gathers pointers to pages and *then* issues ->readpage() on
> them. Without any protection against hole-punching.
Ugh. It should just lock them when it gathers the pointers.
And in fact they *are* locked for the add_to_page_cache_lru() case,
but the splice code explicitly unlocks them in order to then
unconditionally lock them *again* in the IO path.
Oh, that's just crazy. And stupid.
You're right, that code just has to be killed. It's too wrong to live.
If you can replace it with the generic read iterator, then that does
indeed just fix things. So color me convinced.
Linus
More information about the xfs
mailing list