From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A82FC2F5492 for ; Mon, 22 Dec 2025 15:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766416414; cv=none; b=NVlp1HAlF3j6Ca2z+12xBMHGEg3AD09k1O6VN7JbzCTF9beC5m6rZQ7xX3hoz117oTBkG3pEYAUeiAhYBkPR7R52RDKns8a7FfGmRVfmJKqxRFQxR2FyU0Z78GlxEDrBHlKo7+MeOSMM1n/u0o5tFu+g0m9M4Sa3WxWOBe/wL2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766416414; c=relaxed/simple; bh=WBlXdh5MaJsrJ9F8YOSLBzpiAr38j2S/p7Q4URKOsOA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t4t4iwOjRw130IpO4yt5p9T6WRoJ6JJ2KYiF2TNNATriGm+VPWH4vPM9khjJrTOsfO30A2ldsWKRHpaP5BV79TT+A7A7pXWTcd91WpG5ZGUF6dmsllnLPtEX21nLgTjMz+b/qhxUHxtEOR/2XC/+sKcT71CBPuf0ag6uBVTswK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=uhKCukeU; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uhKCukeU" 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=5Qd6QV049o4axEDniRrULvw2mERwDhNTPYNQm37g5xU=; b=uhKCukeUdZiUW+PHbMTTNrgZjt 8xbcKc4Fzl7bbWwwPAehqnKzUCp+Bg5D75nJ3ViDslX2zjNdJ/NQzRNfarDu9rsKIWA3xxTuQjmGw tCRPwfIhJifhaCBY5HJiqZLu6kvV2ZW/rAODyXg8u3tbPnzDdfs6wBBnyXM3QsV1o3QjIl+a2yUrn 02OUBazitZkTohUYeYJIZgohpJDBZWnCBUft69LUej0D7+taZLy5j6B0vQYFenS7tHbstrpIO70mZ U0d11rZy+Hxjylh/49AxFGt+/1pCrqkUYLdh67LaHBVN6hkuMycuZbg/3okEZE8kkZZlaG8NBqYVy ATX7Gdeg==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vXhbC-0000000Br5c-44NX; Mon, 22 Dec 2025 15:13:27 +0000 Date: Mon, 22 Dec 2025 15:13:26 +0000 From: Matthew Wilcox To: Jan Kara Cc: Deepakkumar Karn , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm/filemap: make release_folio mandatory and add block_release_folio Message-ID: References: <20251219193751.1453197-2-dkarn@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Dec 22, 2025 at 01:38:51PM +0100, Jan Kara wrote: > > Filesystems updated: adfs, affs, bfs, exfat, ext2, fat, hpfs, isofs, > > jfs, minix, nilfs2, ntfs3, omfs, udf, ufs, plus block/fops.c > > I think affs_aops_ofs need .release_folio as well... > > Also befs_aops, ecryptfs_aops, efs_aops, vxfs_aops, hfs_aops, hfsplus_aops, > nilfs_buffer_cache_aops, qnx4_aops, qnx6_aops definitely need .release_folio. ntfs_aops_cmpr > might need it as well - not sure. If we were using a real programming language, we'd have a class for BH-based filesystems, inherit from it and override each method. But since we aren't, let's see what we can do in C ... #define BH_DEFAULT_AOPS \ .dirty_folio = block_dirty_folio, \ .invalidate_folio = block_invalidate_folio, \ .migrate_folio = buffer_migrate_folio, \ .is_partially_uptodate = block_is_partially_uptodate, \ .error_remove_folio = generic_error_remove_folio, As I understand C, later initialisers override earlier ones [1]. GCC does have an optional warning (-Woverride-init) which is included in -W but not -Wall. Some parts of the kernel explicitly turn this off, either like this: arch/arm64/kvm/Makefile:CFLAGS_sys_regs.o += -Wno-override-init or like this: drivers/gpu/drm/i915/display/intel_display_device.c:__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for display info"); I'd be happy to do either of those for filesystems. [1] Test program: struct ops { void (*frob)(void); }; static void my_frob(void) { return; } void generic_frob(void); struct ops my_ops = { .frob = generic_frob, .frob = my_frob, }; int main(void) { return 0; } $ gcc -Wall -o test2 test2.c links without any missing symbols