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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B32D9C43217 for ; Tue, 19 Oct 2021 18:48:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 835C16128B for ; Tue, 19 Oct 2021 18:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234546AbhJSSuu (ORCPT ); Tue, 19 Oct 2021 14:50:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38515 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232913AbhJSSut (ORCPT ); Tue, 19 Oct 2021 14:50:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634669316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W0LKdMZo9vNdqSvore2I0xfjftCA66bzkuaIif0bJYs=; b=YRwwdefYS2QxW/T3nO7xaHtAGL89oYtF5OaUcDMMu4AkYBsRW5H5j3iDcxLb8Jv/SgSaLo 50TvSO2OU/FSMPV8o6vftn7xtGvOXUGxkFbYPH51Qzmz875VpP0c03rp6l1vMKrv2jOIv/ Xd4yOtf+mEMYc/Gdmfb/+R7htzFWjH4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-j1U2L1iBM6ODM8XJ0ZVuqg-1; Tue, 19 Oct 2021 14:48:32 -0400 X-MC-Unique: j1U2L1iBM6ODM8XJ0ZVuqg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2130C19251A1; Tue, 19 Oct 2021 18:48:30 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 965D65DD68; Tue, 19 Oct 2021 18:48:16 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <163456861570.2614702.14754548462706508617.stgit@warthog.procyon.org.uk> <163456863216.2614702.6384850026368833133.stgit@warthog.procyon.org.uk> To: Matthew Wilcox Cc: dhowells@redhat.com, linux-cachefs@redhat.com, Kent Overstreet , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet , Jeff Layton , Alexander Viro , Omar Sandoval , Linus Torvalds , linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/67] mm: Stop filemap_read() from grabbing a superfluous page MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2971213.1634669295.1@warthog.procyon.org.uk> Date: Tue, 19 Oct 2021 19:48:15 +0100 Message-ID: <2971214.1634669295@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Matthew Wilcox wrote: > > + isize = i_size_read(inode); > > + if (unlikely(iocb->ki_pos >= isize)) > > + goto put_pages; > > + > > Is there a good reason to assign to isize here? I'd rather not, > because it complicates analysis, and a later change might look at > the isize read here, not realising it was a racy use. So I'd > rather see: If we don't set isize, the loop will never end. Actually, maybe we can just break out at that point rather than going to put_pages. David