Linux-Fsdevel Archive on lore.kernel.org
 help / color / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Miklos Szeredi <miklos@szeredi.hu>, Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-aio <linux-aio@kvack.org>,
	syzbot <syzkaller@googlegroups.com>,
	Avi Kivity <avi@scylladb.com>, Eric Dumazet <edumazet@google.com>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH] aio: Fix locking in aio_poll()
Date: Tue, 05 Feb 2019 16:53:04 -0800
Message-ID: <1549414384.34241.77.camel@acm.org> (raw)
In-Reply-To: <CAJfpegtkPSss5LxB3eEK7tLCu+tv5GOeM+Wu+cksUxjvSg3now@mail.gmail.com>

On Tue, 2019-02-05 at 09:12 +0100, Miklos Szeredi wrote:
> Not all variants of the waitqueue interface require irqs to be
> disabled, and fuse has nothing whatsoever to do with irqs, so there's
> no sane reason to disable them.
> 
> Also, AFAICS, the fuse device does not support asynchronous IO.  I
> just don't get what this is about...

Hi Miklos,

Could this be what happens?

aio_poll() calls vfs_poll()
  vfs_poll() calls fuse_dev_poll()
    fuse_dev_poll() calls poll_wait(file, &fiq->waitq, wait)
      poll_wait() calls aio_poll_queue_proc(file, &fiq->waitq, wait)
        aio_poll_queue_proc() stores &fiq->waitq in pt->iocb->poll.head
aio_poll() calls spin_lock_irq(&ctx->ctx_lock)
aio_poll() calls spin_lock(&req->head->lock) (req == &pt->iocb->poll).

I think the lockdep complaint is about the FUSE fiq->waitq lock not being
IRQ-safe and about aio_poll() creating a dependency between an IRQ-safe lock
(ctx->ctx_lock) and a lock that is not IRQ-safe (fiq->waitq).

Thanks,

Bart.

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 17:45 Bart Van Assche
2019-02-04 17:49 ` Christoph Hellwig
2019-02-05  8:12   ` Miklos Szeredi
2019-02-06  0:53     ` Bart Van Assche [this message]
2019-02-06  8:36       ` Miklos Szeredi
2019-02-06 13:47         ` Christoph Hellwig
2019-02-06 14:31           ` Miklos Szeredi
2019-02-06 13:39       ` Christoph Hellwig
2019-02-09  0:59 Bart Van Assche
2019-02-12  7:56 ` Christoph Hellwig
2019-02-21 22:28   ` Bart Van Assche
2019-02-22  3:17     ` Al Viro

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1549414384.34241.77.camel@acm.org \
    --to=bvanassche@acm.org \
    --cc=avi@scylladb.com \
    --cc=edumazet@google.com \
    --cc=hch@lst.de \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=stable@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git