Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4719474rdb; Fri, 15 Sep 2023 10:08:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpBbNpgQk5EcWZIOLIu46sOxsxnE9afoGjmpwfb61RJwx/aYpXqmPZjG6A+iSWc1ifx4cc X-Received: by 2002:a05:6a20:4289:b0:133:bbe0:312f with SMTP id o9-20020a056a20428900b00133bbe0312fmr2974599pzj.50.1694797698062; Fri, 15 Sep 2023 10:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694797698; cv=none; d=google.com; s=arc-20160816; b=AadVkt7dsAlbJFBilSCD9gqIokuCE22KWuNmS88mNDisTni3figNYNdEbd41b88Bse +JzFJwWn6cZZqXZvDcOvFPLCEDsnjOJjOYpxEUTgBElEsSBnoUpTM0+FTtZtOQXGBlR2 vHzsLfAchsUSkHSG8QvO/VtjZ+GkRJ3gICXu07eZI3+Yxu+f0uRcq92h4Im6/rpQXSLX JzESidTIVCFQWoLOdUMURjwWU4xAHB0tiTU5BJLHBUcfDFeeMMSH9zr3f/GJD557jOL9 JIhUMFHCDT0KpoMIaNYCXW4f1E71GCNw3k250admbbgmmbqk4iCIDYrRBkwvWSoHtzQe xbmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=weIH6q/GO+uKb6SAS3pj9bawpU6jDya1ZswVdnm0Tks=; fh=ardmABoZqyzAm25ow9fvqe18o8v8L1P0+Wo2I9sPHpg=; b=KO8b6fBP5jBkqHboy6Ay6ldBjAVoQcfXwmixUREIHe0oY/WmfIVD0l8g0qUwmJcVq6 28yFrXayXco+zqjzM2KQZOdbZ8QMIGr7mTjvDyGsDBH+5ngHNMdDPlI5gG89VbMlWT2q +YmI4te70J3FN67jKf42IwHpewHguMpeTaDkpuCnFPlX16lbgoIgdI4kaX5u9y1AaeOh l2t184nsngxd9+BA3ulqDT+d6g77Jr0GCoxFVAsf2fg/ONA/5frqtOe6zbGxEsM1VKE1 hBR3xQBKnnPqjW4IPUIywKLrAbTff2fkoG2gCKi9TH9PlThhzMKAWj4WCsZNyCC1+4wU fn6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FNQLLzaj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id t187-20020a632dc4000000b00565322ef4f1si3515550pgt.348.2023.09.15.10.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FNQLLzaj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A9C41817C8BA; Fri, 15 Sep 2023 08:38:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236165AbjIOPhw (ORCPT + 99 others); Fri, 15 Sep 2023 11:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbjIOPh0 (ORCPT ); Fri, 15 Sep 2023 11:37:26 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F41E6A; Fri, 15 Sep 2023 08:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=weIH6q/GO+uKb6SAS3pj9bawpU6jDya1ZswVdnm0Tks=; b=FNQLLzaj1CwiOfRn1Lldn35Jzd DT1YcE7xPmC0F7GEMiORREJofQ5NNNTGAQI7J+AqKLze307fPYBF4pD21N1aXmQBzerFdswgRnS1P vQEC9UpHQ30gq48dA2CCNeO4beU8Ov7SPJerssNhILXF8Bz7B2jghZCzL/bnD2HQLRNipXg6cyqQh NDdoodU50PsoE+QaJ4cT4Tsj5+F7RrpFH+DKCBEUQwoOVUzRBLZfsRXYmx0tEwn+9EpC8BRJsoDSe 8QuvQvtLKPbEMGNxJ/xCcqM7EHZ/S6uyUme27VK0mA5QF5i7f5rq9PyQBBo5mrrt00e/kjrfWefhO Iu6wRUNg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qhAsc-00AX14-Cv; Fri, 15 Sep 2023 15:37:14 +0000 Date: Fri, 15 Sep 2023 16:37:14 +0100 From: Matthew Wilcox To: Daniel Gomez Cc: "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH 5/6] shmem: add file length in shmem_get_folio path Message-ID: References: <20230915095042.1320180-1-da.gomez@samsung.com> <20230915095042.1320180-6-da.gomez@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230915095042.1320180-6-da.gomez@samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:38:20 -0700 (PDT) On Fri, Sep 15, 2023 at 09:51:29AM +0000, Daniel Gomez wrote: > @@ -2251,7 +2252,7 @@ static vm_fault_t shmem_fault(struct vm_fault *vmf) > } > > err = shmem_get_folio_gfp(inode, vmf->pgoff, &folio, SGP_CACHE, > - gfp, vma, vmf, &ret); > + gfp, vma, vmf, &ret, i_size_read(inode)); Surely this should be PAGE_SIZE not i_size? > @@ -4923,7 +4927,7 @@ struct folio *shmem_read_folio_gfp(struct address_space *mapping, > > BUG_ON(!shmem_mapping(mapping)); > error = shmem_get_folio_gfp(inode, index, &folio, SGP_CACHE, > - gfp, NULL, NULL, NULL); > + gfp, NULL, NULL, NULL, i_size_read(inode)); Same here?