diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-08-14 18:37:03 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-15 14:24:30 +0200 |
commit | a6b9b1d5eae61a68085030e50d56265dec5baa94 (patch) | |
tree | c2f8f140cf5d0c1061c9c0e0cd65a46ebe2086ba /drivers/staging/erofs/data.c | |
parent | d247ceda6ae65968bda1bf7a26b54a257a414c7a (diff) | |
download | talos-op-linux-a6b9b1d5eae61a68085030e50d56265dec5baa94.tar.gz talos-op-linux-a6b9b1d5eae61a68085030e50d56265dec5baa94.zip |
staging: erofs: introduce EFSCORRUPTED and more logs
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 <pavel@denx.de>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190814103705.60698-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/data.c')
-rw-r--r-- | drivers/staging/erofs/data.c | 6 |
1 files changed, 4 insertions, 2 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; } |