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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 BB342C433DB for ; Mon, 1 Mar 2021 11:07:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67C336024A for ; Mon, 1 Mar 2021 11:07:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbhCALHJ (ORCPT ); Mon, 1 Mar 2021 06:07:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:53086 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbhCALHE (ORCPT ); Mon, 1 Mar 2021 06:07:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C1E68AE03; Mon, 1 Mar 2021 11:06:22 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id F3A7CDA7B0; Mon, 1 Mar 2021 12:04:27 +0100 (CET) Date: Mon, 1 Mar 2021 12:04:27 +0100 From: David Sterba To: Christoph Hellwig Cc: Stephen Rothwell , Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List , Martin Raiber , "Matthew Wilcox (Oracle)" Subject: Re: linux-next: manual merge of the akpm-current tree with the btrfs tree Message-ID: <20210301110427.GT7604@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Christoph Hellwig , Stephen Rothwell , Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List , Martin Raiber , "Matthew Wilcox (Oracle)" References: <20210127223918.1b3e4b3f@canb.auug.org.au> <20210215084634.06c1b430@canb.auug.org.au> <20210226103250.7b08a233@canb.auug.org.au> <20210226051626.GA2072@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210226051626.GA2072@lst.de> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Fri, Feb 26, 2021 at 06:16:26AM +0100, Christoph Hellwig wrote: > On Fri, Feb 26, 2021 at 10:32:50AM +1100, Stephen Rothwell wrote: > > > > - return filemap_read(iocb, to, ret); > > > > + if (iocb->ki_flags & IOCB_NOWAIT) > > > > + iocb->ki_flags |= IOCB_NOIO; > > > > + > > > > - ret = generic_file_buffered_read(iocb, to, ret); > > > > ++ ret = filemap_read(iocb, to, ret); > > > > + > > > > + if (iocb->ki_flags & IOCB_NOWAIT) { > > > > + iocb->ki_flags &= ~IOCB_NOIO; > > > > + if (ret == 0) > > > > + ret = -EAGAIN; > > > > + } > > > > + > > > > + return ret; > > > > } > > I think the above code looks completely bogus. Instead whatever code > in btrfs hecks for IOCB_NOIO to avoid blocking readahead should also > check IOCB_NOWAIT. Thanks for the comment, I've removed the patch from for-next and notified the authors.