From nobody Fri Apr 3 22:50:12 2026 Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) (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 3C4EE36494E; Mon, 23 Mar 2026 07:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.143.211.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774252551; cv=none; b=ag+9ySnR+d/MoF4rcrK+iIdyE+WS/nsYJqh0JmhIYF9jGUubCtil0kMPABMp6RjFQTj1PlG9ul7KLEn9Bi7V66YnVEBoS+lEwMN83R288p75n9oIN1RAW1Fx6svewj0iQqy0tDRAIAQSCn9VvGa7hp6dvae3xytODuJHcdG8fXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774252551; c=relaxed/simple; bh=LwM/ySBHJQ1CQHhHJhHAEj1bfdurPYzkMFlDbs4Q+ig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZUBURGaz9NK9dOWQIeA1AeT26zsTu2R17brF5QanLp4tqFpU7uRVspAORu+SERli3Ph1GDWvMZRsaw4ekRNNO1KzqQimQ3ZwffBJfX+67pLeFAr+i5bt1m6vMqOpaQ1n5ueA64c6o9+PSJTyHZJCSNwQGGScSkgFjTWYApFliW0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=swemel.ru; spf=pass smtp.mailfrom=swemel.ru; dkim=pass (1024-bit key) header.d=swemel.ru header.i=@swemel.ru header.b=L4lneEn1; arc=none smtp.client-ip=95.143.211.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=swemel.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=swemel.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=swemel.ru header.i=@swemel.ru header.b="L4lneEn1" From: Denis Arefev DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swemel.ru; s=mail; t=1774252090; 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=MFw/vB8P7VLJD61eJATtRx37nqbkMe0J8+xFPuYrJvQ=; b=L4lneEn13a7wHcip66v1l2hXTXW+pN7j2AWRig9HY9F1A4XZFDV00ILPxqBos9TTRsjb5d Ewo2TErc7WIdziEvQjCh1J0iSjL/TAPavhBkMCc0WAP4XUQKd5tYAOjiQKjnWak3F+2ZTd BwHm4SA2zeeBMAy5NvK7tcN2DtRqkuQ= To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Gao Xiang Subject: [PATCH 6.1 1/1] erofs: enable large folios for iomap mode Date: Mon, 23 Mar 2026 10:48:06 +0300 Message-ID: <20260323074809.4542-2-arefev@swemel.ru> In-Reply-To: <20260323074809.4542-1-arefev@swemel.ru> References: <20260323074809.4542-1-arefev@swemel.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jingbo Xu = =20 commit ce529cc25b184e93397b94a8a322128fc0095cbb upstream.=20 Enable large folios for iomap mode. Then the readahead routine will pass down large folios containing multiple pages. Let's enable this for non-compressed format for now, until the compression part supports large folios later. When large folios supported, the iomap routine will allocate iomap_page for each large folio and thus we need iomap_release_folio() and iomap_invalidate_folio() to free iomap_page when these folios get reclaimed or invalidated. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20221130060455.44532-1-jefflexu@linux.aliba= ba.com Signed-off-by: Gao Xiang Signed-off-by: Denis Arefev --- Link: https://syzkaller.appspot.com/bug?id=3Dc6aeabd0c4ad2466f63a274faf2a12= 3103f8fbf7 --- fs/erofs/data.c | 2 ++ fs/erofs/inode.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index fe8ac0e163f7..c9526c627dda 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -403,6 +403,8 @@ const struct address_space_operations erofs_raw_access_= aops =3D { .readahead =3D erofs_readahead, .bmap =3D erofs_bmap, .direct_IO =3D noop_direct_IO, + .release_folio =3D iomap_release_folio, + .invalidate_folio =3D iomap_invalidate_folio, }; =20 #ifdef CONFIG_FS_DAX diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index ad2a82f2eb4c..e457b8a59ee7 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -295,6 +295,8 @@ static int erofs_fill_inode(struct inode *inode) goto out_unlock; } inode->i_mapping->a_ops =3D &erofs_raw_access_aops; + if (!erofs_is_fscache_mode(inode->i_sb)) + mapping_set_large_folios(inode->i_mapping); #ifdef CONFIG_EROFS_FS_ONDEMAND if (erofs_is_fscache_mode(inode->i_sb)) inode->i_mapping->a_ops =3D &erofs_fscache_access_aops; --=20 2.43.0