Re: possible circular locking dependency detected
flat view
From: Rainer Weikusat <hidden>
Date: 2016-09-02 16:51:21
Linus Torvalds [off-list ref] writes:
On Thu, Sep 1, 2016 at 2:43 PM, Linus Torvalds [off-list ref] wrote:quoted
On Thu, Sep 1, 2016 at 2:01 PM, Al Viro [off-list ref] wrote:quoted
Outside as in "all fs activity in bind happens under it". Along with assignment to ->u.addr, etc. IOW, make it the outermost lock there.Hah, yes. I misunderstood you. Yes. In fact that fixes the problem I mentioned, rather than introducing it.So the easiest approach would seem to be to revert commit c845acb324aa ("af_unix: Fix splice-bind deadlock"), and then apply the lock split. Like the attached two patches. This is still *entirely* untested.
As far as I can tell, this should work as I can't currently imagine why a fs operation might end up binding a unix socket despite the idea to make af_unix.c yet more complicated in order to work around irregular behaviour of (as far as I can tell) a single filesystem (for which kern_path_create doesn't really mean kern_path_create and it has to work around that once it gets control) goes against all instincts I have in this area. If filesystems need to do arbitrary stuff when __sb_start_write is called for 'their' superblock, they should be able to do so directly. At present, this is a theoretic concern as I can't (due to other work committments) put any non-cursory work into this before Sunday. There may also be other reasons why this idea is impractical or even unworkable.