Re: xfs_file_splice_read: possible circular locking dependency detected

Linus Torvalds <[email protected]>
Newsgroups gmane.comp.file-systems.xfs.general
Message-ID <CA+55aFyPye0WM3RYx=K_eEy=xWbYvMTFtG3Hc1U0_BU4bMMPnA@mail.gmail.com>
On Thu, Sep 8, 2016 at 11:12 AM, Linus Torvalds
<[email protected]> wrote:
>
> So the problem really is that the vfs layer seems to simply not allow
> the filesystem to do any locking around the generic page cache helper
> functions. And XFS really wants to do that.

Hmm.

I wonder if we could just take the pipe lock *much* earlier at the
splice() layer? Do it before any callbacks to the low-level
filesystems, not inside the "generic" splice helpers at all?

That would clean up a ton of crap.

The *one* reason that seems impossible right now seems to be that we
use "pipe_wait()" in our splice ops. And "pipe_wait()" drops and
retakes the pipe lock over the waiting.

BUT.

What if we got rid of all the pipe-wait crap entirely, and just made
all the splice routines return EAGAIN instead of waiting? And then do
the pipe_wait() at the higher level, outside the filesystem callback
code, and outside the low-level generic helpers?

Maybe that pipe_wait() movement doesn't really work for some reason
that I didn't look at, but that would really help make the locking
enormously simpler. And then the pipe lock would *obviously* be the
outermost lock, and we'd get rid of all the issues with filesystem
lock ordering.

               Linus

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.