From: Gao Xiang <gaoxiang25@huawei.com>
To: Chao Yu <yuchao0@huawei.com>, Pavel Machek <pavel@denx.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
<devel@driverdev.osuosl.org>, <linux-fsdevel@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
<linux-erofs@lists.ozlabs.org>, "Chao Yu" <chao@kernel.org>,
Miao Xie <miaoxie@huawei.com>, <weidu.du@huawei.com>,
Fang Wei <fangwei1@huawei.com>, Gao Xiang <gaoxiang25@huawei.com>
Subject: [PATCH v2 2/3] staging: erofs: differentiate unsupported on-disk format
Date: Wed, 14 Aug 2019 18:37:04 +0800 [thread overview]
Message-ID: <20190814103705.60698-2-gaoxiang25@huawei.com> (raw)
In-Reply-To: <20190814103705.60698-1-gaoxiang25@huawei.com>
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>
---
change log from v1:
- use EOPNOTSUPP rather than ENOTSUPP pointed by Chao;
drivers/staging/erofs/inode.c | 4 ++--
drivers/staging/erofs/zmap.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
index 461fd4213ce7..c8f3ded17583 100644
--- a/drivers/staging/erofs/inode.c
+++ b/drivers/staging/erofs/inode.c
@@ -24,7 +24,7 @@ static int read_inode(struct inode *inode, void *data)
errln("unsupported data mapping %u of nid %llu",
vi->datamode, vi->nid);
DBG_BUGON(1);
- return -EIO;
+ return -EOPNOTSUPP;
}
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",
__inode_version(advise), vi->nid);
DBG_BUGON(1);
- return -EIO;
+ return -EOPNOTSUPP;
}
if (!nblks)
diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c
index 16b3625604f4..5551e615e8ea 100644
--- a/drivers/staging/erofs/zmap.c
+++ b/drivers/staging/erofs/zmap.c
@@ -178,7 +178,7 @@ static int vle_legacy_load_cluster_from_disk(struct z_erofs_maprecorder *m,
break;
default:
DBG_BUGON(1);
- return -EIO;
+ return -EOPNOTSUPP;
}
m->type = type;
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",
m->type, lcn, vi->nid);
DBG_BUGON(1);
- return -EIO;
+ return -EOPNOTSUPP;
}
return 0;
}
@@ -436,7 +436,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
default:
errln("unknown type %u at offset %llu of nid %llu",
m.type, ofs, vi->nid);
- err = -EIO;
+ err = -EOPNOTSUPP;
goto unmap_out;
}
--
2.17.1
next prev parent reply other threads:[~2019-08-14 10:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 10:37 [PATCH v2 1/3] staging: erofs: introduce EFSCORRUPTED and more logs Gao Xiang
2019-08-14 10:37 ` Gao Xiang [this message]
2019-08-14 10:37 ` [PATCH v2 3/3] staging: erofs: correct all misused ENOTSUPP Gao Xiang
2019-08-15 1:31 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190814103705.60698-2-gaoxiang25@huawei.com \
--to=gaoxiang25@huawei.com \
--cc=chao@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=fangwei1@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=pavel@denx.de \
--cc=weidu.du@huawei.com \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).