From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75304C282CB for ; Tue, 5 Feb 2019 08:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EFB720818 for ; Tue, 5 Feb 2019 08:13:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="HeM9KGBz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbfBEINF (ORCPT ); Tue, 5 Feb 2019 03:13:05 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:38690 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbfBEINF (ORCPT ); Tue, 5 Feb 2019 03:13:05 -0500 Received: by mail-it1-f194.google.com with SMTP id z20so6132637itc.3 for ; Tue, 05 Feb 2019 00:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SerFKC/AzZ6eIejA5MFJF4UwpzQb5NI9lu08ThACQKs=; b=HeM9KGBz1LCTLyPVTFD3QsVjBk7m8s2G5Tl9zdkQ9Jm+BzKe0qPSa6+g4Hndz3hx3K erCc4KqFJlfAJH0FNGIathdWZTfnH4NTdpSclcTJTdxReqh6yytg8+uGJTsQYEUoQvU2 E+t02S76PuRjuXWj2jf1h5grDEbonBawqKyTg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SerFKC/AzZ6eIejA5MFJF4UwpzQb5NI9lu08ThACQKs=; b=tJkaYwQV7dpep36CfOWf8PIjw+LMcYFFw2WnU81o75RYBinuysv9nTW6MtlVnVmoN4 xJ73aPCDj3egds8/ksSzk66UtZMWrHZXDkn9HAPou+I5+EUJhqVj86PdclVoxLjQxe5V m7u/J9gD65MA1Mj6nwkxTIv4mL6b2VZqZ8muNs1PylfTK71W1ThLus61BF2nOFIMKCN7 HZlgA48AdQ8DYtwN/xrRL1CCkISZcFq+Yb5Sc+FtBwp38E4Ue9nE88EfW03IKhINWkTG xztO+7nEnFrUNS+AWfhKsqeF5dlXiJdaUbd/PWRqQlgaz2ZLeN0Qn5Qnx2ENYwAGYmvE RrPA== X-Gm-Message-State: AHQUAubl31/o2FOc+ixgLWf5dOz5387sxMDwY1HOy/eLyO0LR/VKGSxM +gFjrVMhrE0AzW25MjJzMOcyu/0vJFx5y3iMYP/fYA== X-Google-Smtp-Source: AHgI3IbhICcRhDUGPGoc8Ob/HcAT2lX40Q8okQfIZEGv9KOLfn1SjWAJyd2G5rhPi+ExjR80Imf1SFrUQErjIAzp2sk= X-Received: by 2002:a24:a08a:: with SMTP id o132mr2054109ite.1.1549354384307; Tue, 05 Feb 2019 00:13:04 -0800 (PST) MIME-Version: 1.0 References: <20190204174555.83603-1-bvanassche@acm.org> <20190204174900.GA16229@lst.de> In-Reply-To: <20190204174900.GA16229@lst.de> From: Miklos Szeredi Date: Tue, 5 Feb 2019 09:12:53 +0100 Message-ID: Subject: Re: [PATCH] aio: Fix locking in aio_poll() To: Christoph Hellwig Cc: Bart Van Assche , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-aio , syzbot , Avi Kivity , Eric Dumazet , stable Content-Type: text/plain; charset="UTF-8" Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Feb 4, 2019 at 6:49 PM Christoph Hellwig wrote: > > On Mon, Feb 04, 2019 at 09:45:55AM -0800, Bart Van Assche wrote: > > Since kioctx.ctx_lock may be acquired from IRQ context, all code that > > acquires that lock from thread context must disable interrupts. This > > patch fixes the following lockdep complaint: > > But breaks the real life users of this interface :( > > aio_poll_wake is assigned as the wake function to a waitqueue, > and the waitqueue interface requires that function to be called > with irqs disabled. It looks like the fuse code is breaking that > contract, so we need to fix that instead of disable irqs. 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... Thanks, Miklos