* [PATCH v2] erofs: leave compressed inodes unsupported in fscache mode for now
@ 2022-05-26 1:03 Jeffle Xu
2022-05-29 7:04 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Jeffle Xu @ 2022-05-26 1:03 UTC (permalink / raw)
To: xiang, chao, linux-erofs; +Cc: linux-kernel
erofs over fscache doesn't support the compressed layout yet. It will
cause NULL crash if there are compressed inodes contained when working
in fscache mode.
So far in the erofs based container image distribution scenarios
(RAFS v6), the compressed RAFS v6 images are downloaded and then
decompressed on demand as an uncompressed erofs image. Then the erofs
image is mounted in fscache mode for containers to use. IOWs, currently
compressed data is decompressed on the userspace side instead and
uncompressed erofs images will be finally cached.
The fscache support for the compressed layout is still under
development and it will be used for runtime decompression feature.
Anyway, to avoid the potential crash, let's leave the compressed inodes
unsupported in fscache mode until we support it later.
Fixes: 1442b02b66ad ("erofs: implement fscache-based data read for non-inline layout")
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
fs/erofs/inode.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index bcc8335b46b3..95a403720e8c 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -288,7 +288,10 @@ static int erofs_fill_inode(struct inode *inode, int isdir)
}
if (erofs_inode_is_data_compressed(vi->datalayout)) {
- err = z_erofs_fill_inode(inode);
+ if (!erofs_is_fscache_mode(inode->i_sb))
+ err = z_erofs_fill_inode(inode);
+ else
+ err = -EOPNOTSUPP;
goto out_unlock;
}
inode->i_mapping->a_ops = &erofs_raw_access_aops;
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] erofs: leave compressed inodes unsupported in fscache mode for now
2022-05-26 1:03 [PATCH v2] erofs: leave compressed inodes unsupported in fscache mode for now Jeffle Xu
@ 2022-05-29 7:04 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2022-05-29 7:04 UTC (permalink / raw)
To: Jeffle Xu, xiang, linux-erofs; +Cc: linux-kernel
On 2022/5/26 9:03, Jeffle Xu wrote:
> erofs over fscache doesn't support the compressed layout yet. It will
> cause NULL crash if there are compressed inodes contained when working
> in fscache mode.
>
> So far in the erofs based container image distribution scenarios
> (RAFS v6), the compressed RAFS v6 images are downloaded and then
> decompressed on demand as an uncompressed erofs image. Then the erofs
> image is mounted in fscache mode for containers to use. IOWs, currently
> compressed data is decompressed on the userspace side instead and
> uncompressed erofs images will be finally cached.
>
> The fscache support for the compressed layout is still under
> development and it will be used for runtime decompression feature.
> Anyway, to avoid the potential crash, let's leave the compressed inodes
> unsupported in fscache mode until we support it later.
>
> Fixes: 1442b02b66ad ("erofs: implement fscache-based data read for non-inline layout")
> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-29 7:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 1:03 [PATCH v2] erofs: leave compressed inodes unsupported in fscache mode for now Jeffle Xu
2022-05-29 7:04 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®