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=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 B4017C4727D for ; Tue, 22 Sep 2020 13:19:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 828812396D for ; Tue, 22 Sep 2020 13:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbgIVNTl (ORCPT ); Tue, 22 Sep 2020 09:19:41 -0400 Received: from verein.lst.de ([213.95.11.211]:44564 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgIVNTl (ORCPT ); Tue, 22 Sep 2020 09:19:41 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DE23167373; Tue, 22 Sep 2020 15:19:39 +0200 (CEST) Date: Tue, 22 Sep 2020 15:19:39 +0200 From: "hch@lst.de" To: Johannes Thumshirn Cc: Goldwyn Rodrigues , "linux-fsdevel@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "david@fromorbit.com" , "hch@lst.de" , "dsterba@suse.com" , "darrick.wong@oracle.com" , "josef@toxicpanda.com" , Goldwyn Rodrigues Subject: Re: [PATCH 03/15] iomap: Allow filesystem to call iomap_dio_complete without i_rwsem Message-ID: <20200922131939.GB20432@lst.de> References: <20200921144353.31319-1-rgoldwyn@suse.de> <20200921144353.31319-4-rgoldwyn@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Sep 21, 2020 at 03:09:29PM +0000, Johannes Thumshirn wrote: > On 21/09/2020 16:44, Goldwyn Rodrigues wrote: > > From: Christoph Hellwig > > > > This is to avoid the deadlock caused in btrfs because of O_DIRECT | > > O_DSYNC. > > > > Filesystems such as btrfs require i_rwsem while performing sync on a > > file. iomap_dio_rw() is called under i_rw_sem. This leads to a > > deadlock because of: > > > > iomap_dio_complete() > > generic_write_sync() > > btrfs_sync_file() > > > > Separate out iomap_dio_complete() from iomap_dio_rw(), so filesystems > > can call iomap_dio_complete() after unlocking i_rwsem. > > > > Signed-off-by: Goldwyn Rodrigues > > > > This is missing Christoph's S-o-b Goldwyn picked this up for a rfc. But this looks like my patch with a sane commit log, so: Signed-off-by: Christoph Hellwig