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.2 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 8396BC433DB for ; Fri, 26 Feb 2021 05:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 250AC64ED5 for ; Fri, 26 Feb 2021 05:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbhBZFRL (ORCPT ); Fri, 26 Feb 2021 00:17:11 -0500 Received: from verein.lst.de ([213.95.11.211]:44476 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhBZFRK (ORCPT ); Fri, 26 Feb 2021 00:17:10 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 7EBA768BEB; Fri, 26 Feb 2021 06:16:26 +0100 (CET) Date: Fri, 26 Feb 2021 06:16:26 +0100 From: Christoph Hellwig To: Stephen Rothwell Cc: David Sterba , Andrew Morton , Christoph Hellwig , 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: <20210226051626.GA2072@lst.de> References: <20210127223918.1b3e4b3f@canb.auug.org.au> <20210215084634.06c1b430@canb.auug.org.au> <20210226103250.7b08a233@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210226103250.7b08a233@canb.auug.org.au> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org 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.