Re: xfs_file_splice_read: possible circular locking dependency detected

Linus Torvalds <[email protected]> Thu, 8 Sep 2016 19:39:12 -0700
Newsgroups gmane.comp.file-systems.xfs.general
Message-ID <CA+55aFz0qYrVFqz_TLs0U9Us5fhB89CUV+x_Gje-oL9BaYT2rg@mail.gmail.com>
On Thu, Sep 8, 2016 at 7:31 PM, Al Viro <[email protected]> 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

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs