From patchwork Wed Aug 14 10:37:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gao Xiang X-Patchwork-Id: 11093679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4180313AC for ; Wed, 14 Aug 2019 10:37:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D5932877F for ; Wed, 14 Aug 2019 10:37:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 210F1287C9; Wed, 14 Aug 2019 10:37:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD50E2877F for ; Wed, 14 Aug 2019 10:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbfHNKht (ORCPT ); Wed, 14 Aug 2019 06:37:49 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57992 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726411AbfHNKht (ORCPT ); Wed, 14 Aug 2019 06:37:49 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 2BFBBF8CE2F7EE151AD9; Wed, 14 Aug 2019 18:37:47 +0800 (CST) Received: from architecture4.huawei.com (10.140.130.215) by smtp.huawei.com (10.3.19.214) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 14 Aug 2019 18:37:39 +0800 From: Gao Xiang To: Chao Yu , Pavel Machek , "Greg Kroah-Hartman" , , CC: LKML , , "Chao Yu" , Miao Xie , , Fang Wei , Gao Xiang Subject: [PATCH v2 2/3] staging: erofs: differentiate unsupported on-disk format Date: Wed, 14 Aug 2019 18:37:04 +0800 Message-ID: <20190814103705.60698-2-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190814103705.60698-1-gaoxiang25@huawei.com> References: <20190814103705.60698-1-gaoxiang25@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.140.130.215] X-CFilter-Loop: Reflected Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For some specific fields, use EOPNOTSUPP instead of EIO for values which look sane but aren't supported right now. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- 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; }