Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp951045pxb; Thu, 25 Feb 2021 21:18:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzo3DTRvpFXNNBjHl6lx5Fv0DP+UOsOjY5RXDVZS/Cs5ptiwzSKf1MmNVS2835SF2b2ALS X-Received: by 2002:a17:907:76ed:: with SMTP id kg13mr1286423ejc.99.1614316726301; Thu, 25 Feb 2021 21:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614316726; cv=none; d=google.com; s=arc-20160816; b=R4qePx7NpzDdoH0EU6RkjTB5FZqqODe4VyAnBEu/irMWfYtXCfbpj92ILL4DG0G3f5 eOCqC4zHQdjrlzSqaPfZ3WQDHvjU6D8FChOwnHl4NZgxlRA0OFqYjLXUt/enKU0atwiF LSQ6ZqMmAUhlk90ezwrs+J/PhJvCrFBLjK5Wh5OqWL6sjK7dGVdQY6HcBmY8h5ak9bde mYQm5G06OcezLwXUJIB411GjHP5zKaD2WxXaShSMbXDITx6klHGMflclR5QXvfdHHjYe uR3aNMfZQN/s+aN5grZDHX3Q8slWYpSoLF6Wb0RTlRfXin+TiETt6xLo+4WLofewHxag 9riQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=WVr72D6tNoyGT/rlHWvg69+RJlGkkitReHEGb0sBZtY=; b=b3VX0hgEap58A8Iql1vxcm/GhNF6olS6rNV71GpokJKMOygehNbAHRo1lUd+CjHAqi S9jCPtIG6c8on5jrsOlHA4VMZDC0WnpQX/LkIpeTis3S/T1TbfVK+eJDxTKLM0E9vfmU eOxJ8Sk6EBphBmLzgUb0IKw1BXTv4NwVANiuAFeDtq0VNCb7KXsZyboKLTipVD0oySsg uXX9SyaMWlCLK9SUdUlIksUUUGAKJ2rGO4Ulz49RNSAqoXYCOut30GowSURK294l1tKz E9NayG42Xd3ES4DlU4QBEP0H7Nip20OTGX0pKQCEnUxGHxpLCxqJwP4kRMC4PrrnrWQp bO+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si3138963edt.426.2021.02.25.21.18.11; Thu, 25 Feb 2021 21:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbhBZFRL (ORCPT + 99 others); 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-kernel@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.