staging: erofs: differentiate unsupported on-disk format

For some specific fields, use EOPNOTSUPP instead of EIO
for values which look sane but aren't supported right now.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190814103705.60698-2-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Gao Xiang 2019-08-14 18:37:04 +08:00 committed by Greg Kroah-Hartman
parent a6b9b1d5ea
commit 382329a9d8
2 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ static int read_inode(struct inode *inode, void *data)
errln("unsupported data mapping %u of nid %llu", errln("unsupported data mapping %u of nid %llu",
vi->datamode, vi->nid); vi->datamode, vi->nid);
DBG_BUGON(1); DBG_BUGON(1);
return -EIO; return -EOPNOTSUPP;
} }
if (__inode_version(advise) == EROFS_INODE_LAYOUT_V2) { if (__inode_version(advise) == EROFS_INODE_LAYOUT_V2) {
@ -95,7 +95,7 @@ static int read_inode(struct inode *inode, void *data)
errln("unsupported on-disk inode version %u of nid %llu", errln("unsupported on-disk inode version %u of nid %llu",
__inode_version(advise), vi->nid); __inode_version(advise), vi->nid);
DBG_BUGON(1); DBG_BUGON(1);
return -EIO; return -EOPNOTSUPP;
} }
if (!nblks) if (!nblks)

View File

@ -178,7 +178,7 @@ static int vle_legacy_load_cluster_from_disk(struct z_erofs_maprecorder *m,
break; break;
default: default:
DBG_BUGON(1); DBG_BUGON(1);
return -EIO; return -EOPNOTSUPP;
} }
m->type = type; m->type = type;
return 0; return 0;
@ -362,7 +362,7 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m,
errln("unknown type %u at lcn %lu of nid %llu", errln("unknown type %u at lcn %lu of nid %llu",
m->type, lcn, vi->nid); m->type, lcn, vi->nid);
DBG_BUGON(1); DBG_BUGON(1);
return -EIO; return -EOPNOTSUPP;
} }
return 0; return 0;
} }
@ -436,7 +436,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
default: default:
errln("unknown type %u at offset %llu of nid %llu", errln("unknown type %u at offset %llu of nid %llu",
m.type, ofs, vi->nid); m.type, ofs, vi->nid);
err = -EIO; err = -EOPNOTSUPP;
goto unmap_out; goto unmap_out;
} }