Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2468791rwd; Fri, 26 May 2023 07:03:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UdIQa/C2LHv8Fpkj09UDqOtrTTiZGoRpw7UvCYzxfxw7s2lbUtCf/dCJVx7wNUh31qs4J X-Received: by 2002:a05:6a20:12c7:b0:10b:d3e0:78a7 with SMTP id v7-20020a056a2012c700b0010bd3e078a7mr2405976pzg.61.1685109799063; Fri, 26 May 2023 07:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685109799; cv=none; d=google.com; s=arc-20160816; b=gkk2pXTgKtFpbtkez4/uU2YmmI1GIOcyrr1zY45+6TDoy2bRZdc0JVoBeUPTzArCE4 eeIBUdnA+YG/iuvHYK4OALP6pUbaytPA50Hxi5YdohkiCWYlN3WnjQ4zwtKn13utP+1p jSq5VPKgTEyl/ou3qgRLQIMf2t+t2vXnmFwCDE4TT+5DwgcysbQ6ZHLjOiNgL6R5Oba2 XxSdOZ5eeka5+ewVelLfKF3IyLiMZ99raYPr7Nu5AYFJBFqwys6WT3psteBM3ToDcTtT HLC8A1IKAX6DptkU6aBg4c2rnhnyp9c+UnzRsF44Ypj6i8DzkRIEsqS4pgSF4SJezkHq kQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=4n8uWwoKijuf7hNq7pa6eDg5K8Opr8XjUEd1CHMUr5Q=; b=ONahOjItLSWM86omb4gIz99udrDGqUMmW/iK5kIh5h+s5Fc0HkjmMXlwclsjGeugGr osGv1jgCZD6UmlLZpA56LGEOvVcfa4M9qSnEvL36lgu2hCtB7NuddLZVYSR4DmXMMECD tNHovLYcp+PVI4YPDtFbFdGMkZ8IaVMF6GAYx/7R5wGTJIKQlbW6V1BJt2zMV/0Okg56 P2BTBo+JGztNamPhHj2hQGy7ZyCPgPNum217xHJ7Fu4SwhKe9UV0QPtFn/f1KcOv5EZJ OJ+iVOZVqib2DB/QFy6LyRsuGa14/LSGNsZRHe9vlC7o45ItSpBCAXY7p0hCLdAKJHy0 4xhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=Z4Qhd1Ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a637546000000b0053427b6841dsi2522227pgn.337.2023.05.26.07.02.54; Fri, 26 May 2023 07:03:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=Z4Qhd1Ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243784AbjEZN5l (ORCPT + 99 others); Fri, 26 May 2023 09:57:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243780AbjEZN5k (ORCPT ); Fri, 26 May 2023 09:57:40 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4740EF3 for ; Fri, 26 May 2023 06:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1685109459; x=1716645459; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=4n8uWwoKijuf7hNq7pa6eDg5K8Opr8XjUEd1CHMUr5Q=; b=Z4Qhd1HaPyBYT/3hKcPykXUdMHlRUjMoitobLFnFMNVvzG20o+wtN/1k qz5+VYMu0ENl107lr1jXK/I72S+rKiJLsN3lbCZu1922d5AuN9PlYF4K/ PVdxD5jWc/SOyYz8NK35Mllq7FStFKEn9txAH6RroiGQsqJ2Zo+slRAuQ O2aKgxMyRgfUmcu6HjV6n9T8yZbDdtKL6hiQ16VqhioJn9iBXvKCxCVUI e3BAvnzrJEKxr+8kbS0EwIOXDuxsqzDMyEElkzMZnf2mQTu+5+8meR1oO 78XsKHb9jmHW2Z9SEr/TwfsKjah7v3zPHOZSLYp+/0h11Sv5hcI2WKrk9 w==; From: Vincent Whitchurch Date: Fri, 26 May 2023 15:57:31 +0200 Subject: [PATCH mm-nonmm-unstable v2 2/2] squashfs: fix page indices MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20230526-squashfs-cache-fixup-v2-2-6fb7723c3647@axis.com> References: <20230526-squashfs-cache-fixup-v2-0-6fb7723c3647@axis.com> In-Reply-To: <20230526-squashfs-cache-fixup-v2-0-6fb7723c3647@axis.com> To: Phillip Lougher , Andrew Morton CC: , , , "Vincent Whitchurch" X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The page cache functions want the page index as an argument but we're currently passing in the byte address. Signed-off-by: Vincent Whitchurch --- fs/squashfs/block.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index f2412e5fc84b..6aa9c2e1e8eb 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -142,7 +142,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio, if (head_to_cache) { int ret = add_to_page_cache_lru(head_to_cache, cache_mapping, - read_start, GFP_NOIO); + read_start >> PAGE_SHIFT, + GFP_NOIO); if (!ret) { SetPageUptodate(head_to_cache); @@ -153,7 +154,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio, if (tail_to_cache) { int ret = add_to_page_cache_lru(tail_to_cache, cache_mapping, - read_end - PAGE_SIZE, GFP_NOIO); + (read_end >> PAGE_SHIFT) - 1, + GFP_NOIO); if (!ret) { SetPageUptodate(tail_to_cache); @@ -192,7 +194,7 @@ static int squashfs_bio_read(struct super_block *sb, u64 index, int length, if (cache_mapping) page = find_get_page(cache_mapping, - read_start + i * PAGE_SIZE); + (read_start >> PAGE_SHIFT) + i); if (!page) page = alloc_page(GFP_NOIO); -- 2.34.1