Message ID | 20240301164444.3799288-13-kernel@pankajraghav.com (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 DE055C5475B for <linux-mm@archiver.kernel.org>; Fri, 1 Mar 2024 16:45:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BEB394000B; Fri, 1 Mar 2024 11:45:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 66A10940007; Fri, 1 Mar 2024 11:45:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E44194000B; Fri, 1 Mar 2024 11:45:34 -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 39728940007 for <linux-mm@kvack.org>; Fri, 1 Mar 2024 11:45:34 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 129E941383 for <linux-mm@kvack.org>; Fri, 1 Mar 2024 16:45:34 +0000 (UTC) X-FDA: 81849046188.24.6291A8B Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by imf01.hostedemail.com (Postfix) with ESMTP id 7DF9B4001A for <linux-mm@kvack.org>; Fri, 1 Mar 2024 16:45:32 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=nwU+P+9a; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf01.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709311532; h=from:from: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=jHOAd9x0YRVSd/dvnN0auN+I3KtosAxaAU4ZYQzup9I=; b=6U5vFveMFCO1EqjhkXfpYTivN5VcwluPQjlVw5JPIhE+AtAfYpk9FY6W+3FMuWF9GrtHOf COegWtLu76pDvJIkPBvOBxP0humD2AFaaBaNtacXiVnRKGWQTS5/DrX6IHXP8h8NPmsQ4J y74ucVIuCEYQ8wIdD6TtQZ6hsAIecyU= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=nwU+P+9a; dmarc=pass (policy=quarantine) header.from=pankajraghav.com; spf=pass (imf01.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.172 as permitted sender) smtp.mailfrom=me@pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709311532; a=rsa-sha256; cv=none; b=8ScBfIUfzD/zxN6tJ4c6M9gkrAGfnbxRAdGgsBaBegezb35vw4l+9zVweTDB2qcr2IKplt M5k6PlqVpSo2YYoj3tNQzAcXQpAbrT5tIeGgKfD+q1oR8tkT2MkxfkKKd0nOybSzijsYvw C7ja3lC2GtBRaHvelHr7iHMBXLVASTM= Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4TmYqY3ft9z9tW7; Fri, 1 Mar 2024 17:45:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1709311529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jHOAd9x0YRVSd/dvnN0auN+I3KtosAxaAU4ZYQzup9I=; b=nwU+P+9a3uF5NA7u6ijpi6mGj8WO2v/jjNlHzx7ZxLokEZE5PEgAPYYwNjrPK+Tms9wLwQ Pyz3Y6zKfMOGrh0h2VqWh2Xebs6ECkTHOJxrSP7lJmYSxooolgOm898sH7IfMtja4+xGbf QGn8iUq+WZZldhVy+gb1dxTa7Ny3C2BlNxq8eJnkFSDSoR0286+8t8p0UrDuC+8w/zds3S J+TgIDqaXHtYS/JGkjQDAQcq9WsaFH8ovt/DcyClf+Qc4mFxK3M8JiIMBwy0/MNjgfSVTg I9Fss6QCWHr13cCBIdBsFbx2KvYCliOGQ3dKcsxyAWzBWPURp+SXGtiqkS2XGA== From: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com> To: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Cc: djwong@kernel.org, mcgrof@kernel.org, linux-mm@kvack.org, hare@suse.de, david@fromorbit.com, akpm@linux-foundation.org, gost.dev@samsung.com, linux-kernel@vger.kernel.org, chandan.babu@oracle.com, willy@infradead.org, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH v2 12/13] xfs: make the calculation generic in xfs_sb_validate_fsb_count() Date: Fri, 1 Mar 2024 17:44:43 +0100 Message-ID: <20240301164444.3799288-13-kernel@pankajraghav.com> In-Reply-To: <20240301164444.3799288-1-kernel@pankajraghav.com> References: <20240301164444.3799288-1-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DF9B4001A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: fwmirigortyi1b8r6fkxcizm1tgg7qxn X-HE-Tag: 1709311532-237216 X-HE-Meta: U2FsdGVkX1870QBWjXkOg+PKeuGGCjQdRoeVOTjt+WC8eZOMBxTQal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: Ham, tests=bogofilter, spamicity=0.000013, 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 in XFS
|
expand
|
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index aabb25dc3efa..9cf800586da7 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -133,9 +133,16 @@ xfs_sb_validate_fsb_count( { ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); ASSERT(sbp->sb_blocklog >= BBSHIFT); + uint64_t max_index; + uint64_t max_bytes; + + if (check_shl_overflow(nblocks, sbp->sb_blocklog, &max_bytes)) + return -EFBIG; /* Limited by ULONG_MAX of page cache index */ - if (nblocks >> (PAGE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) + max_index = max_bytes >> PAGE_SHIFT; + + if (max_index > ULONG_MAX) return -EFBIG; return 0; }