summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorXin Yin <yinxin.x@bytedance.com>2023-07-11 14:21:30 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-23 13:53:47 +0200
commitf30de55777c9a2829e7f9b81e61ec7d8cfac9285 (patch)
treed2d9f324438a1995d6e532dcba60ac9c9fb697dd /fs
parent3cf79e59ca0f0cdb3506c7aeb88a7059e2307ff6 (diff)
downloadlinux-stable-f30de55777c9a2829e7f9b81e61ec7d8cfac9285.tar.gz
linux-stable-f30de55777c9a2829e7f9b81e61ec7d8cfac9285.tar.bz2
linux-stable-f30de55777c9a2829e7f9b81e61ec7d8cfac9285.zip
erofs: fix fsdax unavailability for chunk-based regular files
[ Upstream commit 18bddc5b67038722cb88fcf51fbf41a0277092cb ] 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: c5aa903a59db ("erofs: support reading chunk-based uncompressed files") Signed-off-by: Xin Yin <yinxin.x@bytedance.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230711062130.7860-1-yinxin.x@bytedance.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/erofs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index d70b12b81507..e12592727a54 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -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)