From: Jingbo Xu Date: Fri, 15 Sep 2023 08:27:28 +0000 (+0800) Subject: erofs: allow empty device tags in flatdev mode X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f939aeea7ab7d96cd321e7ac107f5a070836b66f;p=linux.git erofs: allow empty device tags in flatdev mode Device tags aren't actually required in flatdev mode, thus fix mount failure due to empty device tags in flatdev mode. Signed-off-by: Jingbo Xu Fixes: 8b465fecc35a ("erofs: support flattened block device for multi-blob images") Reviewed-by: Jia Zhu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230915082728.56588-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang --- diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 44a24d573f1fd..3700af9ee1733 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -235,7 +235,7 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb, return PTR_ERR(ptr); dis = ptr + erofs_blkoff(sb, *pos); - if (!dif->path) { + if (!sbi->devs->flatdev && !dif->path) { if (!dis->tag[0]) { erofs_err(sb, "empty device tag @ pos %llu", *pos); return -EINVAL;