From patchwork Tue Feb 13 09:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pankaj Raghav (Samsung)" X-Patchwork-Id: 13554794 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14329C4829A for ; Tue, 13 Feb 2024 09:38:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B9968D000C; Tue, 13 Feb 2024 04:38:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 96A098D0001; Tue, 13 Feb 2024 04:38:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 795B98D000C; Tue, 13 Feb 2024 04:38:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 64AAA8D0001 for ; Tue, 13 Feb 2024 04:38:09 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 43A11A0B15 for ; Tue, 13 Feb 2024 09:38:09 +0000 (UTC) X-FDA: 81786279498.06.DBA6B2B Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by imf12.hostedemail.com (Postfix) with ESMTP id B5F1840020 for ; Tue, 13 Feb 2024 09:38:07 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=lAJKQkv8; spf=pass (imf12.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707817087; 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=+2ss5SlGBbWn5UCkRFfS2rrVeqSyvxI6jrmUJVBEXU4=; b=P2PHZZ+7ILDf7dCMBlYjK3sp6gqsk4ElTv5Qpid90gah2BXP2rMqPe4cTXpN6jXxKAvSMb rgIn8jpgu5M6HfFKWMG87/6upNxGEgFl3hDZGcKm8vd2sVYTXQEm71JFPRauErpwGEswRG lDvh8LQ6B7FD+382/QqWC8kmcVfwaDo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707817087; a=rsa-sha256; cv=none; b=cqupNaSG+Plti8tkiRZdneRo1CDFFwgroIHy4OtLEM854noxbrZc7HbHsZmUAgF+f4bQOI ag3+Kq28pxOliNpU9BSujkAXhO+xJYtnZOyQyZUryT3UJjKm7NuBanYzCGmGn3/XrJ2rYq 8btByKBdSgBZf4E6tRPgex+ytxroxhI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=lAJKQkv8; spf=pass (imf12.hostedemail.com: domain of me@pankajraghav.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=me@pankajraghav.com; dmarc=none Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (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-201.mailbox.org (Postfix) with ESMTPS id 4TYx8D3Xykz9t40; Tue, 13 Feb 2024 10:38:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1707817084; 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=+2ss5SlGBbWn5UCkRFfS2rrVeqSyvxI6jrmUJVBEXU4=; b=lAJKQkv8JFUfAalsowcHUM0qevPxPDym9zxQEdcsGZ1QD34oloukLEkuEh9wYi/vwk3vTz 88MWHR5ma60yh6fcF9kNUWOoPzhytLjV6Ujqkm3NEpqVKXssY+AJ7VmlsSzPHrbWqiHHA/ nnbX4EV4Fhls9o8I6ajQX4wDUiZx29RHWX8bCkX0wpri4sldWbDFrGm1ryQp5raRgie1qr Lqsie4oCOj0gEl5zUVTbX8ms0OBr8KlMQBHEY4+8qUfqB3zPYcRNxXNbTgt3YZGojnJJEv sgKHAUiic9WDKzyryMjZWH9/hR/YdqHkJvfMwSZBVuLypx3foevRXAeEudMk+A== From: "Pankaj Raghav (Samsung)" To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: mcgrof@kernel.org, gost.dev@samsung.com, akpm@linux-foundation.org, kbusch@kernel.org, djwong@kernel.org, chandan.babu@oracle.com, p.raghav@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, willy@infradead.org, linux-mm@kvack.org, david@fromorbit.com Subject: [RFC v2 13/14] xfs: add an experimental CONFIG_XFS_LBS option Date: Tue, 13 Feb 2024 10:37:12 +0100 Message-ID: <20240213093713.1753368-14-kernel@pankajraghav.com> In-Reply-To: <20240213093713.1753368-1-kernel@pankajraghav.com> References: <20240213093713.1753368-1-kernel@pankajraghav.com> MIME-Version: 1.0 X-Stat-Signature: cbmgon4nuxjcz96b5ryzxtuouthghmtb X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B5F1840020 X-Rspam-User: X-HE-Tag: 1707817087-121631 X-HE-Meta: U2FsdGVkX1/OgUxW32fRpI8tnEL4qOX6hsBIUvjVNIXTz6Z5wvPZekuzzb9KojcilKfm8PKYekEDgR8RL09X557cFdcBiny8bRTRuV4kfQQShqy94T9gHHZptyE+D4XCv0WHAMUVnB2jhLYq9T4x1YPrsiEBktoRB4HN8Y7AJEAmr0kc9+j1rMc9e9pFc75hJ5UiTX32JYqeORtHeTcgu1gK54AVP0mZ21U6I61ORasulY5d++dz5g0eGzXN+6ZgkHoM1eJpqDmWlqvVbR+Nk6sTOB3w4P6dK0RJLWbeUjOkps8sia8xo8yitxhSH2hO+eEcJ0XmhY/mFXOD0FtJi8nmc+rcYK2vUlH48QUl0e0boW03FpZeDd9u7D4k9wTo9SU4Eid/8+uXNY5EmA04VXGa2x7IQQqWY5hJB24y6lqN/xyOumB48ak0M9+9wfrdKZqqs85nmSvS2xK6lk0r6R7STSe8Essl98AQqMGxutUr+U/9I3T3RVqjCFsUcL8+Vr8vbs+gnvGUVu35i8y6POhF5QRQRFhplyFgCLkl+6baubPRa+54al+iNYDYdmwM4JEO01FFNPs40rmXrpll4kg+bl9QjL+howRZ09vdr/oMFgPZVwg/jyuvvWaRP21zOJEfzb8FmJ/a0oudZmQe0ip5FVbMBhRwolP2guQwc+VkvwoHuYnZBJAdqCUtwIyloOOlzGMonLMReh5b5k7FWDHiUForSHtYBFhGu0BdyB22Tr2XgEc97Hj8G77QdH5yQNs7ogwCo3KWudRlRFXeIYcfhrgsFLBl7TZLO62N7V6kCYobg3pS1L7aoDVn363+57dLeQKPptXYGIfnw/ZEpc7WUWlUy+ZPnx1WhwzR3gPKVmiXyQQFsS7M72xJg0q/4qPEGMRira1qoeTVDv8yH5pG5ug7mz1oi/alVTVY4wWTcJ12ejwrTL59pkKq7X8AjyY0k2IUxefqu/vC1E8 CWnYB9pR g2A2J43h1Yzs/CX1oUjlk9lwssb+/e4iDOJlsuy1PScgf2PeCS/rTSkFNh8zDT6KRPZxjPTEHrCUH0IT8nzbvWUQv3U6e7R6JhqiylhwxDDiUzvo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Pankaj Raghav Add an experimental CONFIG_XFS_LBS option to enable LBS support in XFS. Retain the ASSERT for PAGE_SHIFT if CONFIG_XFS_LBS is not enabled. Signed-off-by: Pankaj Raghav Reviewed-by: Darrick J. Wong --- fs/xfs/Kconfig | 11 +++++++++++ fs/xfs/xfs_mount.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index 567fb37274d3..6b0db2f7dc13 100644 --- a/fs/xfs/Kconfig +++ b/fs/xfs/Kconfig @@ -216,3 +216,14 @@ config XFS_ASSERT_FATAL result in warnings. This behavior can be modified at runtime via sysfs. + +config XFS_LBS + bool "XFS large block size support (EXPERIMENTAL)" + depends on XFS_FS + help + Set Y to enable support for filesystem block size > system's + base page size. + + This feature is considered EXPERIMENTAL. Use with caution! + + If unsure, say N. diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index bfbaaecaf668..596aa2cdefbc 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -131,11 +131,13 @@ xfs_sb_validate_fsb_count( xfs_sb_t *sbp, uint64_t nblocks) { - ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); ASSERT(sbp->sb_blocklog >= BBSHIFT); unsigned long mapping_count; uint64_t bytes = nblocks << sbp->sb_blocklog; + if (!IS_ENABLED(CONFIG_XFS_LBS)) + ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); + mapping_count = bytes >> PAGE_SHIFT; /* Limited by ULONG_MAX of page cache index */