From mboxrd@z Thu Jan 1 00:00:00 1970 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 D07D8C3DA49 for ; Tue, 16 Jul 2024 17:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FBFF6B0088; Tue, 16 Jul 2024 13:46:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4ABEA6B0092; Tue, 16 Jul 2024 13:46:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39B1C6B0093; Tue, 16 Jul 2024 13:46:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1B6E26B0088 for ; Tue, 16 Jul 2024 13:46:58 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C789E40611 for ; Tue, 16 Jul 2024 17:46:57 +0000 (UTC) X-FDA: 82346346474.21.6ED17FC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 2B7E3140013 for ; Tue, 16 Jul 2024 17:46:53 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="r7x052J/"; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721151987; a=rsa-sha256; cv=none; b=yUcqGJEi5ycOLQbi/Y28uMRQCYal2aPuoCD0VnXZwc7reXJeKqKMX07Jz06NtgpNp8MIx/ HmYdOhNj+/LEXC/2G2SzKZ2VNiBNeRp8IYK/JG5A2zU2wRxqJHUe+xLF3g7cKNXoseBIrd FMtZ1N1EOPV8bVtX9mOSR3doAScRtFo= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="r7x052J/"; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721151987; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ra6y1t4n6GxPoGrXbJCTMwqrGtbY4JF2QAmbOWwYp3Q=; b=SPl+NmWnEByHwuenCwK1m6OFTwoe+hu7FpYxrWp1heXKsYSVF6ksAkUnlAdkbv0mNPt2rM ZzlW07nP2jsYOboGbPom89bpbdK4S5ehtpEWG/sBej1Im6oMTxyUbJDzyoeYe2mzkQ/lAl 1mhN9K7Yo7nGyz6EMqHxJqfjLGP6rZo= 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=ra6y1t4n6GxPoGrXbJCTMwqrGtbY4JF2QAmbOWwYp3Q=; b=r7x052J/t+uGYyNUOCFtT+noc5 i4d6Jt+hV6vhBmtdgdyORa250S5TRlW9ERvLS7MEnyDJ7RQmOsi3SzBOQtTcOmvgLZcRs+z0Lc+fc TAevcJwwAPO2uGoxDZpfMIpe65ji9mWr2gd+Z3c2L3cWlc2PbZmor+u5/1mj6JhHcGYrfbKJawym/ UL4Vyn2Z57PT301VYzQVb6eovnnGYwq3uYJ6ybBhydhvaPlINxXQkr0Rk3ZTmnAXMMU4MPm9yGq7s //2/00WIv8LDY2JjmOwh0bB5KsviU/Hlwo/+I+JLIZKM4/8qRs+Bb8cK8h2e0zGqI/xFfIYY2hCgs s0MCScrA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTmG8-0000000HMwh-3iT4; Tue, 16 Jul 2024 17:46:40 +0000 Date: Tue, 16 Jul 2024 18:46:40 +0100 From: Matthew Wilcox To: "Darrick J. Wong" Cc: "Pankaj Raghav (Samsung)" , david@fromorbit.com, chandan.babu@oracle.com, brauner@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, yang@os.amperecomputing.com, linux-mm@kvack.org, john.g.garry@oracle.com, linux-fsdevel@vger.kernel.org, hare@suse.de, p.raghav@samsung.com, mcgrof@kernel.org, gost.dev@samsung.com, cl@os.amperecomputing.com, linux-xfs@vger.kernel.org, ryan.roberts@arm.com, hch@lst.de, Zi Yan Subject: Re: [PATCH v10 10/10] xfs: enable block size larger than page size support Message-ID: References: <20240715094457.452836-1-kernel@pankajraghav.com> <20240715094457.452836-11-kernel@pankajraghav.com> <20240716174016.GZ1998502@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240716174016.GZ1998502@frogsfrogsfrogs> X-Rspamd-Queue-Id: 2B7E3140013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 83ep1oqxsrp4yjqnuc9954tjjkkru81d X-HE-Tag: 1721152013-924529 X-HE-Meta: U2FsdGVkX197I8lMAhzGdmNNx3mnUM4gfbjqTvHQGlm1WgQleC6K8Lb4yAnUbLV/xkzLP2WPCbabM77Xed++AoMUrxGI7p/zZ/YOSXRYFA9KBOIpmxb5o2pA0sL47URH83G7kaqpGPmYNugrUMcR8oiEzo/czhTHPA8FpzgpZ/xlvCXuID22JmLE0rsy/yL7hqmsCOzP9vkH2VilZaVnFQPRH/SCZx4k4ntq60vrFNXh/YgFt2x6oXJGrx7xUxFdmU6qo4nzwpYT4xm8IcbvTmaPWpctTJrxt6V85HSWt82YFyBRk8/CyLluoG0gib8qXWLLa5Nn/bbSC5cElZmsEEmDWh2PbYDMefXBK9xnLWenFKeTWHDpgsYPRdhAXfwTent068ADMBeyK4jOFX3F2z+2ZxhIagZY99zItOp5+mf8iuEJ1jNJeYvFy0f+Edn087ch8qCSWaFkr5SgwME3qBE7VG8j9Iiesns8Ej3XNNDqocX3riB0HyUwMzQLDLXmhHLrV0kBhgz9Lz7BqlzPHM2Z6WfHtS3ILfZ7Zhf00qHq6wb0GUdcNleJJ2tojefGi/j/w/4ZyxhaYTk0ur++gRS3EiSH1tVN+1yITv5VuMy9RCFsbP7KH67EerBbK6U5E/qL7Cbijs9ZWx2j+sxgXMa1oQuqlxEAABPrmWIhz4/26zQeq6kuTSC7SIVkCefW++rZqbmcl9nfxJNCaw3oRSY6qhs62TWON0Dq3JjD2bbfOGPafdcJ5WAW6k1cUPageJg2xPkb9lq7pZz0INzpAhRrYgZzv9I3B5P31ShecwAfrrjFPNoBdneX/DaRE9+yC+gQYleq4hQmCjJAo2nOPgNieCuVcOfQemwXkBvSrqIQqdVUY0ssoXxAYaM5OkHgbgvIslyPUSASfXy68UnFGwWD+CuQhGQyvciV3H3Bye0PoR+H5U/VPlIZivwR1/pa2q0OJ7D32XRl4d8ikD8 9TkaGXwB hyc+XvxXTw634tccjt3cIxLHvRT2weMLCAhXHn/yYe4uEobPzRpAy8cjdUAfukvG4Uwg4LQtLjowIYqf1n+XfnA/fkveS0LLEgPrV5+SnHMlhTpJBDBrOmZrQoAata0AhOfTSMfOqyofZ0Igipn94c/aAHicqfBeaMYjf2JovOd4FhiazO+TmW7neWK75a7znK3brY5FRa96mbNw= 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: On Tue, Jul 16, 2024 at 10:40:16AM -0700, Darrick J. Wong wrote: > On Tue, Jul 16, 2024 at 04:29:05PM +0100, Matthew Wilcox wrote: > > On Mon, Jul 15, 2024 at 11:44:57AM +0200, Pankaj Raghav (Samsung) wrote: > > > +++ b/fs/xfs/xfs_super.c > > > @@ -1638,16 +1638,30 @@ xfs_fs_fill_super( > > > goto out_free_sb; > > > } > > > > > > - /* > > > - * Until this is fixed only page-sized or smaller data blocks work. > > > - */ > > > if (mp->m_sb.sb_blocksize > PAGE_SIZE) { > > > - xfs_warn(mp, > > > - "File system with blocksize %d bytes. " > > > - "Only pagesize (%ld) or less will currently work.", > > > + size_t max_folio_size = mapping_max_folio_size_supported(); > > > + > > > + if (!xfs_has_crc(mp)) { > > > + xfs_warn(mp, > > > +"V4 Filesystem with blocksize %d bytes. Only pagesize (%ld) or less is supported.", > > > mp->m_sb.sb_blocksize, PAGE_SIZE); > > > - error = -ENOSYS; > > > - goto out_free_sb; > > > + error = -ENOSYS; > > > + goto out_free_sb; > > > + } > > > + > > > + if (mp->m_sb.sb_blocksize > max_folio_size) { > > > + xfs_warn(mp, > > > +"block size (%u bytes) not supported; maximum folio size supported in "\ > > > +"the page cache is (%ld bytes). Check MAX_PAGECACHE_ORDER (%d)", > > > + mp->m_sb.sb_blocksize, max_folio_size, > > > + MAX_PAGECACHE_ORDER); > > > > Again, too much message. Way too much. We shouldn't even allow block > > devices to be created if their block size is larger than the max supported > > by the page cache. > > Filesystem blocksize != block device blocksize. xfs still needs this > check because one can xfs_copy a 64k-fsblock xfs to a hdd with 512b > sectors and try to mount that on x86. > > Assuming there /is/ some fs that allows 1G blocksize, you'd then really > want a mount check that would prevent you from mounting that. Absolutely, we need to have an fs blocksize check in the fs (if only because fs fuzzers will put random values in fields and expect the system to not crash). But that should have nothing to do with page cache size.