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=-5.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 AD372C432C0 for ; Tue, 26 Nov 2019 16:33:27 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 744ED2071A; Tue, 26 Nov 2019 16:33:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="brUx2ZAP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="cUUyiZ6T"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="O865r2R5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 744ED2071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iZdmI-0000oM-JZ; Tue, 26 Nov 2019 16:33:26 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iZdmH-0000ny-Dz for linux-f2fs-devel@lists.sourceforge.net; Tue, 26 Nov 2019 16:33:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cP6D8d93btaoA8qKKMvE5cAQ11moEVEbDuB/dLF9EyE=; b=brUx2ZAPOytIq/ZanI2jycZ1ur ZeyLAHcZ4pwgUZJsQQugfXDEVYLFwv9/h/nUn1F8BxueK0lXbrdSG1bugaimuBDckX5HB9DBl9Tax NEvUfvLxqeQhAtx6LN8IL6bAQhCA4V74DhWsZh6UAlK0zeZ/sks3rzleWy6u2CbPQhU0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cP6D8d93btaoA8qKKMvE5cAQ11moEVEbDuB/dLF9EyE=; b=cUUyiZ6TWeliguqTeWnJEKTCCN 7Zda1B4loDYgZnFar4gO0vDQOcGnSc1pBTrvwSgBx6bbacQsL+UYGGt+aLTtKlxCZB9elO+FKHkPB fMnmU5UISyku1cuqLUn4lkK+5Q5KsTfy2LQhLKFMi/IbYhPoomhYw4VQreafINzlfrT8=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1iZdmG-00EAFs-0r for linux-f2fs-devel@lists.sourceforge.net; Tue, 26 Nov 2019 16:33:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cP6D8d93btaoA8qKKMvE5cAQ11moEVEbDuB/dLF9EyE=; b=O865r2R5Df3+XvnupVgKsHKR7 N+KUqyQTu01ck0k+RGuNCnvWDOXz7KHLCfS8l/GsJyvXcmIQ6RBDborEb6f0ta0fPiQDiIaVtsl2n iFvwBw8eA0/Z0sQ4qintTOrKzZbOzr56Rd/Jn15ThIhKWQ8N9HfajwHZ4vLTBm2ee7++zRj7QcnGD ROfwSDHIaVb7+UFgFQxUgequQ6/OY0xQGr0ihFwX+MqOJ9Di0d6e3TbsmfDPWrAj0KX+AFWh4ffv7 Vug3oVJnr52Eav3PwickrC1puoquU+b/ti23rL5+SsQa6lYYe6uM3Je87dd9aoAKevQCasRMROtcX jyBhJcMWw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZdm7-0005YJ-4G; Tue, 26 Nov 2019 16:33:15 +0000 Date: Tue, 26 Nov 2019 08:33:15 -0800 From: Christoph Hellwig To: Damien Le Moal Message-ID: <20191126163315.GB3794@infradead.org> References: <20191126075719.1046485-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191126075719.1046485-1-damien.lemoal@wdc.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Headers-End: 1iZdmG-00EAFs-0r Subject: Re: [f2fs-dev] [PATCH] f2fs: Fix direct IO handling X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Javier Gonzalez , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Jaegeuk Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Tue, Nov 26, 2019 at 04:57:19PM +0900, Damien Le Moal wrote: > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 5755e897a5f0..8ac2d3b70022 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1073,6 +1073,8 @@ int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from) > int flag; > int err = 0; > bool direct_io = iocb->ki_flags & IOCB_DIRECT; > + bool do_direct_io = direct_io && > + !f2fs_force_buffered_io(inode, iocb, from); I don't think this is the right fix. The proper fix is to clear IOCB_DIRECT when falling back to buffered I/O, preferably in the filemap.c helpers as well. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel