Skip to content

Commit 18bddc5

Browse files
Xin Yinhsiangkao
authored andcommitted
erofs: fix fsdax unavailability for chunk-based regular files
DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios. Fixes: c5aa903 ("erofs: support reading chunk-based uncompressed files") Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent 8191213 commit 18bddc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/erofs/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,
183183

184184
inode->i_flags &= ~S_DAX;
185185
if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) &&
186-
vi->datalayout == EROFS_INODE_FLAT_PLAIN)
186+
(vi->datalayout == EROFS_INODE_FLAT_PLAIN ||
187+
vi->datalayout == EROFS_INODE_CHUNK_BASED))
187188
inode->i_flags |= S_DAX;
188189

189190
if (!nblks)

0 commit comments

Comments
 (0)