Skip to content

Commit

Permalink
erofs: fix fsdax unavailability for chunk-based regular files
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Xin Yin authored and hsiangkao committed Jul 11, 2023
1 parent 8191213 commit 18bddc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/erofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,

inode->i_flags &= ~S_DAX;
if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) &&
vi->datalayout == EROFS_INODE_FLAT_PLAIN)
(vi->datalayout == EROFS_INODE_FLAT_PLAIN ||
vi->datalayout == EROFS_INODE_CHUNK_BASED))
inode->i_flags |= S_DAX;

if (!nblks)
Expand Down

0 comments on commit 18bddc5

Please sign in to comment.