From patchwork Wed Aug 14 10:37:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gao Xiang X-Patchwork-Id: 11093681 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 1808913AC for ; Wed, 14 Aug 2019 10:38:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 018A5287A1 for ; Wed, 14 Aug 2019 10:38:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E969C287CC; Wed, 14 Aug 2019 10:38:03 +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 2390C287A1 for ; Wed, 14 Aug 2019 10:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbfHNKh6 (ORCPT ); Wed, 14 Aug 2019 06:37:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57996 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726166AbfHNKht (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 31B2095A4597CCF664B3; 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:37 +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 1/3] staging: erofs: introduce EFSCORRUPTED and more logs Date: Wed, 14 Aug 2019 18:37:03 +0800 Message-ID: <20190814103705.60698-1-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 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 Previously, EROFS uses EIO to indicate that filesystem is corrupted as well. However, as Pavel said [1], other filesystems tend to use EUCLEAN(EFSCORRUPTED) instead, let's follow what others do right now. Also, add some more prints to the syslog. [1] https://lore.kernel.org/lkml/20190813114821.GB11559@amd/ Suggested-by: Pavel Machek Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- change log from v1: - update the commit message; This patchset has dependency on the previous patchset yesterday https://lore.kernel.org/lkml/20190813023054.73126-1-gaoxiang25@huawei.com/ Thanks, Gao Xiang drivers/staging/erofs/data.c | 6 ++++-- drivers/staging/erofs/dir.c | 15 ++++++++------- drivers/staging/erofs/inode.c | 17 ++++++++++++----- drivers/staging/erofs/internal.h | 2 ++ drivers/staging/erofs/namei.c | 6 ++++-- drivers/staging/erofs/xattr.c | 5 +++-- drivers/staging/erofs/zmap.c | 5 +++-- 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c index 4cdb743c8b8d..72c4b4c5296b 100644 --- a/drivers/staging/erofs/data.c +++ b/drivers/staging/erofs/data.c @@ -143,10 +143,12 @@ static int erofs_map_blocks_flatmode(struct inode *inode, vi->xattr_isize + erofs_blkoff(map->m_la); map->m_plen = inode->i_size - offset; - /* inline data should locate in one meta block */ + /* inline data should be located in one meta block */ if (erofs_blkoff(map->m_pa) + map->m_plen > PAGE_SIZE) { + errln("inline data cross block boundary @ nid %llu", + vi->nid); DBG_BUGON(1); - err = -EIO; + err = -EFSCORRUPTED; goto err_out; } diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c index 2fbfc4935077..01efc96e1212 100644 --- a/drivers/staging/erofs/dir.c +++ b/drivers/staging/erofs/dir.c @@ -34,7 +34,7 @@ static void debug_one_dentry(unsigned char d_type, const char *de_name, #endif } -static int erofs_fill_dentries(struct dir_context *ctx, +static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx, void *dentry_blk, unsigned int *ofs, unsigned int nameoff, unsigned int maxsize) { @@ -63,8 +63,9 @@ static int erofs_fill_dentries(struct dir_context *ctx, /* a corrupted entry is found */ if (unlikely(nameoff + de_namelen > maxsize || de_namelen > EROFS_NAME_LEN)) { + errln("bogus dirent @ nid %llu", EROFS_V(dir)->nid); DBG_BUGON(1); - return -EIO; + return -EFSCORRUPTED; } debug_one_dentry(d_type, de_name, de_namelen); @@ -104,10 +105,9 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx) if (unlikely(nameoff < sizeof(struct erofs_dirent) || nameoff >= PAGE_SIZE)) { - errln("%s, invalid de[0].nameoff %u", - __func__, nameoff); - - err = -EIO; + errln("%s, invalid de[0].nameoff %u @ nid %llu", + __func__, nameoff, EROFS_V(dir)->nid); + err = -EFSCORRUPTED; goto skip_this; } @@ -123,7 +123,8 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx) goto skip_this; } - err = erofs_fill_dentries(ctx, de, &ofs, nameoff, maxsize); + err = erofs_fill_dentries(dir, ctx, de, &ofs, + nameoff, maxsize); skip_this: kunmap(dentry_page); diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index 286729143365..461fd4213ce7 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -43,7 +43,7 @@ static int read_inode(struct inode *inode, void *data) else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) inode->i_rdev = 0; else - return -EIO; + goto bogusimode; i_uid_write(inode, le32_to_cpu(v2->i_uid)); i_gid_write(inode, le32_to_cpu(v2->i_gid)); @@ -76,7 +76,7 @@ static int read_inode(struct inode *inode, void *data) else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) inode->i_rdev = 0; else - return -EIO; + goto bogusimode; i_uid_write(inode, le16_to_cpu(v1->i_uid)); i_gid_write(inode, le16_to_cpu(v1->i_gid)); @@ -104,6 +104,11 @@ static int read_inode(struct inode *inode, void *data) else inode->i_blocks = nblks << LOG_SECTORS_PER_BLOCK; return 0; + +bogusimode: + errln("bogus i_mode (%o) @ nid %llu", inode->i_mode, vi->nid); + DBG_BUGON(1); + return -EFSCORRUPTED; } /* @@ -137,9 +142,11 @@ static int fill_inline_data(struct inode *inode, void *data, /* inline symlink data shouldn't across page boundary as well */ if (unlikely(m_pofs + inode->i_size > PAGE_SIZE)) { - DBG_BUGON(1); kfree(lnk); - return -EIO; + errln("inline data cross block boundary @ nid %llu", + vi->nid); + DBG_BUGON(1); + return -EFSCORRUPTED; } /* get in-page inline data */ @@ -200,7 +207,7 @@ static int fill_inode(struct inode *inode, int isdir) init_special_inode(inode, inode->i_mode, inode->i_rdev); goto out_unlock; } else { - err = -EIO; + err = -EFSCORRUPTED; goto out_unlock; } diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 4ce5991c381f..12f737cbc0c0 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -548,5 +548,7 @@ static inline int z_erofs_init_zip_subsystem(void) { return 0; } static inline void z_erofs_exit_zip_subsystem(void) {} #endif /* !CONFIG_EROFS_FS_ZIP */ +#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ + #endif /* __EROFS_INTERNAL_H */ diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c index 8e06526da023..c0963f5a2d22 100644 --- a/drivers/staging/erofs/namei.c +++ b/drivers/staging/erofs/namei.c @@ -116,10 +116,12 @@ static struct page *find_target_block_classic(struct inode *dir, struct erofs_qstr dname; if (unlikely(!ndirents)) { - DBG_BUGON(1); kunmap_atomic(de); put_page(page); - page = ERR_PTR(-EIO); + errln("corrupted dir block %d @ nid %llu", + mid, EROFS_V(dir)->nid); + DBG_BUGON(1); + page = ERR_PTR(-EFSCORRUPTED); goto out; } diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c index 289c7850ec96..c5bfc9be412f 100644 --- a/drivers/staging/erofs/xattr.c +++ b/drivers/staging/erofs/xattr.c @@ -75,8 +75,9 @@ static int init_inode_xattrs(struct inode *inode) goto out_unlock; } else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) { if (unlikely(vi->xattr_isize)) { + errln("bogus xattr ibody @ nid %llu", vi->nid); DBG_BUGON(1); - ret = -EIO; + ret = -EFSCORRUPTED; goto out_unlock; /* xattr ondisk layout error */ } ret = -ENOATTR; @@ -237,7 +238,7 @@ static int xattr_foreach(struct xattr_iter *it, /* xattr on-disk corruption: xattr entry beyond xattr_isize */ if (unlikely(*tlimit < entry_sz)) { DBG_BUGON(1); - return -EIO; + return -EFSCORRUPTED; } *tlimit -= entry_sz; } diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index aeed5c674d9e..16b3625604f4 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -338,8 +338,9 @@ static int vle_extent_lookback(struct z_erofs_maprecorder *m, int err; if (lcn < lookback_distance) { + errln("bogus lookback distance @ nid %llu", vi->nid); DBG_BUGON(1); - return -EIO; + return -EFSCORRUPTED; } /* load extent head logical cluster if needed */ @@ -419,7 +420,7 @@ int z_erofs_map_blocks_iter(struct inode *inode, if (unlikely(!m.lcn)) { errln("invalid logical cluster 0 at nid %llu", vi->nid); - err = -EIO; + err = -EFSCORRUPTED; goto unmap_out; } end = (m.lcn << lclusterbits) | m.clusterofs; 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; } From patchwork Wed Aug 14 10:37:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gao Xiang X-Patchwork-Id: 11093677 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 A355F13B1 for ; Wed, 14 Aug 2019 10:37:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E55E2877F for ; Wed, 14 Aug 2019 10:37:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 819D9287A1; Wed, 14 Aug 2019 10:37:54 +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 08F9C287A1 for ; Wed, 14 Aug 2019 10:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbfHNKht (ORCPT ); Wed, 14 Aug 2019 06:37:49 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:58000 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726230AbfHNKht (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 383BC3802EDB3BCF20C5; 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:40 +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 3/3] staging: erofs: correct all misused ENOTSUPP Date: Wed, 14 Aug 2019 18:37:05 +0800 Message-ID: <20190814103705.60698-3-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 As Chao pointed out [1], ENOTSUPP is used for NFS protocol only, we should use EOPNOTSUPP instead... [1] https://lore.kernel.org/lkml/108ee2f9-75dd-b8ab-8da7-b81c17bafbf6@huawei.com/ Reported-by: Chao Yu Signed-off-by: Gao Xiang Reviewed-by: Chao Yu --- drivers/staging/erofs/decompressor.c | 2 +- drivers/staging/erofs/internal.h | 6 +++--- drivers/staging/erofs/xattr.c | 2 +- drivers/staging/erofs/xattr.h | 4 ++-- drivers/staging/erofs/zmap.c | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/erofs/decompressor.c b/drivers/staging/erofs/decompressor.c index 5361a2bbedb6..32a811ac704a 100644 --- a/drivers/staging/erofs/decompressor.c +++ b/drivers/staging/erofs/decompressor.c @@ -124,7 +124,7 @@ static int lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out) int ret; if (rq->inputsize > PAGE_SIZE) - return -ENOTSUPP; + return -EOPNOTSUPP; src = kmap_atomic(*rq->in); inputmargin = 0; diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 12f737cbc0c0..0e8d58546c52 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -403,12 +403,12 @@ int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map, int flags); #else -static inline int z_erofs_fill_inode(struct inode *inode) { return -ENOTSUPP; } +static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; } static inline int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map, int flags) { - return -ENOTSUPP; + return -EOPNOTSUPP; } #endif /* !CONFIG_EROFS_FS_ZIP */ @@ -516,7 +516,7 @@ void *erofs_get_pcpubuf(unsigned int pagenr); #else static inline void *erofs_get_pcpubuf(unsigned int pagenr) { - return ERR_PTR(-ENOTSUPP); + return ERR_PTR(-EOPNOTSUPP); } #define erofs_put_pcpubuf(buf) do {} while (0) diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c index c5bfc9be412f..e7e5840e3f9d 100644 --- a/drivers/staging/erofs/xattr.c +++ b/drivers/staging/erofs/xattr.c @@ -71,7 +71,7 @@ static int init_inode_xattrs(struct inode *inode) if (vi->xattr_isize == sizeof(struct erofs_xattr_ibody_header)) { errln("xattr_isize %d of nid %llu is not supported yet", vi->xattr_isize, vi->nid); - ret = -ENOTSUPP; + ret = -EOPNOTSUPP; goto out_unlock; } else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) { if (unlikely(vi->xattr_isize)) { diff --git a/drivers/staging/erofs/xattr.h b/drivers/staging/erofs/xattr.h index 63cc87e3d3f4..e20249647541 100644 --- a/drivers/staging/erofs/xattr.h +++ b/drivers/staging/erofs/xattr.h @@ -74,13 +74,13 @@ static inline int erofs_getxattr(struct inode *inode, int index, const char *name, void *buffer, size_t buffer_size) { - return -ENOTSUPP; + return -EOPNOTSUPP; } static inline ssize_t erofs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) { - return -ENOTSUPP; + return -EOPNOTSUPP; } #endif /* !CONFIG_EROFS_FS_XATTR */ diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index 5551e615e8ea..b61b9b5950ac 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -68,7 +68,7 @@ static int fill_inode_lazy(struct inode *inode) if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX) { errln("unknown compression format %u for nid %llu, please upgrade kernel", vi->z_algorithmtype[0], vi->nid); - err = -ENOTSUPP; + err = -EOPNOTSUPP; goto unmap_done; } @@ -79,7 +79,7 @@ static int fill_inode_lazy(struct inode *inode) if (vi->z_physical_clusterbits[0] != LOG_BLOCK_SIZE) { errln("unsupported physical clusterbits %u for nid %llu, please upgrade kernel", vi->z_physical_clusterbits[0], vi->nid); - err = -ENOTSUPP; + err = -EOPNOTSUPP; goto unmap_done; } @@ -211,7 +211,7 @@ static int unpack_compacted_index(struct z_erofs_maprecorder *m, else if (1 << amortizedshift == 2 && lclusterbits == 12) vcnt = 16; else - return -ENOTSUPP; + return -EOPNOTSUPP; encodebits = ((vcnt << amortizedshift) - sizeof(__le32)) * 8 / vcnt; base = round_down(eofs, vcnt << amortizedshift); @@ -275,7 +275,7 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m, int err; if (lclusterbits != 12) - return -ENOTSUPP; + return -EOPNOTSUPP; if (lcn >= totalidx) return -EINVAL;