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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64AE4C43334 for ; Tue, 7 Jun 2022 16:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236694AbiFGQG4 (ORCPT ); Tue, 7 Jun 2022 12:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235088AbiFGQGz (ORCPT ); Tue, 7 Jun 2022 12:06:55 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A8CBFF5AC for ; Tue, 7 Jun 2022 09:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jx0PIwsySTFEp9nSZzszFo1rfglY5ANWvXLXoBrw8Kk=; b=ZDJaIpbCeJ09ORwN0+0lmuyM6u vsnhZ/zXnCz21kG3xLfuz6UeB5W2Xxf9AOPTgxudpgKJOfiQnbXgSTdgL9lavAgm4MRIQGfMy/8uX z/Z0cJgj/mZFKdXQkP3A1fyB4sSk8zbBKbwclTs8lWN/IH0LddpjYNlGSleyjIU2zM7pr/TwDOWSE Iu2FLQDA2BSJdokPuI7CPGnQY6GswqYAmA+IL6W126HDbTdtixjEZKWxQanbYWScgrNFJpTT+LS8h q7QOthycjORlASumyzlsy0eKYITnEoZL6+gt0q9NVdLiUcoHQXra3hlIY/odeyTNZeKJ6qQ1GrwFp cKcgVreQ==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nybjJ-004mxZ-6z; Tue, 07 Jun 2022 16:06:53 +0000 Date: Tue, 7 Jun 2022 16:06:53 +0000 From: Al Viro To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, Jens Axboe , Matthew Wilcox Subject: Re: [PATCH 2/9] btrfs_direct_write(): cleaner way to handle generic_write_sync() suppression Message-ID: References: <20220607044217.GB7887@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220607044217.GB7887@lst.de> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Jun 07, 2022 at 06:42:17AM +0200, Christoph Hellwig wrote: > > diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c > > index 370c3241618a..0f16479b13d6 100644 > > --- a/fs/iomap/direct-io.c > > +++ b/fs/iomap/direct-io.c > > @@ -548,7 +548,7 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, > > } > > > > /* for data sync or sync, we need sync completion processing */ > > - if (iocb->ki_flags & IOCB_DSYNC) > > + if (iocb->ki_flags & IOCB_DSYNC && !(dio_flags & IOMAP_DIO_NOSYNC)) > > Same here. Dealt with in the next commit, actually. > Also the FUA check below needs to check IOMAP_DIO_NOSYNC as > well. Does it? AFAICS, we don't really care about REQ_FUA on any requests - what btrfs hack tries to avoid is stepping into if (ret > 0 && (dio->flags & IOMAP_DIO_NEED_SYNC)) ret = generic_write_sync(iocb, ret); with generic_write_sync() called by btrfs_do_write_iter() after it has dropped the lock held through btrfs_direct_write(). Do we want to suppress REQ_FUA on the requests generated by __iomap_dio_rw() in that case (DSYNC, !SYNC)? Confused...