Skip to contentSkip to conversation

erofs: relax the constraint of non-empty device tag in flatdev mode

PATCH RESEND In review Jingbo Xu 3 participants 3 messages Sep 15, 2023 EROFS file system

lore
Share & tools
lore

Jingbo Xu

author
#0 lore raw

PATCH RESEND 1/1 erofs: relax the constraint of non-empty device tag in flatdev mode

The device tag is not required in flatdev mode, and thus relax this constraint in flatdev mode.

---
Sorry I forget to cc [email protected] in the former patch.

---
 fs/erofs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/super.c +1 -1
index 44a24d573f1f..3700af9ee173 100644
@@ -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;
Signature · 1 line
2.19.1.6.gb485710b
Reviewed-by Jia Zhu on v1 1/1
#1 lore raw
Quoted 4 lines · Jingbo Xu

The device tag is not required in flatdev mode, and thus relax this constraint in flatdev mode.

LGTM

Quoted 19 lines

---
Sorry I forget to cc [email protected] in the former patch.

---
  fs/erofs/super.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/super.c +1 -1
index 44a24d573f1f..3700af9ee173 100644
@@ -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;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jingbo Xu
Quoted 4 lines · Jingbo Xu

The device tag is not required in flatdev mode, and thus relax this constraint in flatdev mode.

I tend to update the subject title and commit message as a fix:

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.

Fixes 8b465fecc35a ("erofs: support flattened block device for multi-blob images")

Thanks,
Gao Xiang