Re: xfs_file_splice_read: possible circular locking dependency detected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 8, 2016 at 7:31 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux