Message ID | 20241214031050.1337920-7-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9817DE77180 for <linux-mm@archiver.kernel.org>; Sat, 14 Dec 2024 03:11:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3C726B0095; Fri, 13 Dec 2024 22:11:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94CA16B009D; Fri, 13 Dec 2024 22:11:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 706456B0095; Fri, 13 Dec 2024 22:11:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0C6D66B0099 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 22:11:02 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9C48412153B for <linux-mm@kvack.org>; Sat, 14 Dec 2024 03:11:01 +0000 (UTC) X-FDA: 82892086830.27.8419A31 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id B4B8320016 for <linux-mm@kvack.org>; Sat, 14 Dec 2024 03:10:33 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=AaqLnJlB; spf=none (imf13.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734145831; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fu2uu1E/hdWYAQ+oUve2n/osalBR9KfPKW7YQSw9qoM=; b=cHd2d/Fq7RiMqnrwRwLbkDG4tckpRSZ/QmM33P4OtX0HDOtiq3JNhZwc7G5taAoHFH5Wof rNycJTpRw9BGfmQNvnl1We/3WHKwaauKIodm3yQ0SZQ5jqGflGMFJ9tQsqCnZtEHMa8mr2 VTGaGSYB37cvNe3IfkVoqKIO+zFjdgw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734145831; a=rsa-sha256; cv=none; b=iUSTJCrB1IfBY334XEOIWyNbe6pWUFb3ZKVwTtr9kAAiVpIUGvRTDaZeisJZsiH7MN/+Lg GfIzmJWZ5D1xRzFrhRnlK/lRU9diglccJhbjIZcoruacLjUExOMX5MRfKOEYQAJ5ofZwDQ GGLPsu487YHi0GPSE2LtKFsoWwBcI8s= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=AaqLnJlB; spf=none (imf13.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=quarantine) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=fu2uu1E/hdWYAQ+oUve2n/osalBR9KfPKW7YQSw9qoM=; b=AaqLnJlBZdgAEm5L97UO99Elg9 nSwRtJ5Oh3gR4SidRU6mFt90VVz+uswm/DRZRf273o490Dg0O6HfiZRMrUUTBIgcA6OuPe89DR+Vg vaQkWlNILmOXkYnVsWtisqS9qNdmSsIeFG8chQ5k17HhmQk8rCRVwKhiO9O1nCDo7QkMNiFt7Yh5J uPSFIk/Lz/RQS3axKLBxUkRTvMoMh+lSyCmjjB904f1VhaIBtKABlUHxaYW8D8E1rb5iszDDWVX1Y HPuyapGGhV0myArKMLDbpY+SLDfnwInKpoU2vRMF5hG0ZLB07t0T2nEWCJx2uFiVKZiqy6/VE3B2q 0Mw72q5Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tMIYN-00000005c3h-3us2; Sat, 14 Dec 2024 03:10:51 +0000 From: Luis Chamberlain <mcgrof@kernel.org> To: willy@infradead.org, hch@lst.de, hare@suse.de, dave@stgolabs.net, david@fromorbit.com, djwong@kernel.org Cc: john.g.garry@oracle.com, ritesh.list@gmail.com, kbusch@kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, kernel@pankajraghav.com, mcgrof@kernel.org, Hannes Reinecke <hare@kernel.org> Subject: [RFC v2 06/11] fs/mpage: avoid negative shift for large blocksize Date: Fri, 13 Dec 2024 19:10:44 -0800 Message-ID: <20241214031050.1337920-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241214031050.1337920-1-mcgrof@kernel.org> References: <20241214031050.1337920-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4B8320016 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: icrwifb6p3aabkwc49dyiewkswc4gsq1 X-Rspamd-Pre-Result: action=add header; module=dmarc; Action set by DMARC X-Rspam: Yes X-HE-Tag: 1734145833-996262 X-HE-Meta: U2FsdGVkX18xUCge+8LVUE5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Bv++5HW15uMplB8FxjA/HP+N55si/6l1Cpz3khoRQUe/lmYgqfhabBUjEJhuTWlx0e6ifta/BifVFGhdF4N6wczPDQH0CVIZm4zVPiDUpOsjtF0oZ5oz1aWLLbP2Xhsh+zc0THUQSb28iwo392jamHEh+JVp2zSdA09NR8ugumQ5iANztjym92FQuKqLxf3P9L3KLd8AHASpQDP258UoXHQ3BxHrymP/WioxiGVrzlPx52Ls0dRCR67iVSOSuK2HlvsPq2faEtzgYOTdgI/ymvMxomQxRCmmhqIg7pN4DQGt4eeEFBUL6uPNFxwD2y2ahOJrJUkPf0HmxI8fPcF1nq0FbFSo2GMHUSLY7C38VX00QIiABIw4KaK0sbPWz9PjajHIRBA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000021, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
enable bs > ps for block devices
|
expand
|
diff --git a/fs/mpage.c b/fs/mpage.c index eb6fee7de529..c6bb2a9706a1 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -181,7 +181,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) if (folio_buffers(folio)) goto confused; - block_in_file = (sector_t)folio->index << (PAGE_SHIFT - blkbits); + block_in_file = folio_pos(folio) >> blkbits; last_block = block_in_file + args->nr_pages * blocks_per_folio; last_block_in_file = (i_size_read(inode) + blocksize - 1) >> blkbits; if (last_block > last_block_in_file) @@ -527,7 +527,7 @@ static int __mpage_writepage(struct folio *folio, struct writeback_control *wbc, * The page has no buffers: map it to disk */ BUG_ON(!folio_test_uptodate(folio)); - block_in_file = (sector_t)folio->index << (PAGE_SHIFT - blkbits); + block_in_file = folio_pos(folio) >> blkbits; /* * Whole page beyond EOF? Skip allocating blocks to avoid leaking * space.