mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-10 18:53:38 +00:00
staging: erofs: fix a missing endian conversion
[ Upstream commit 37ec35a6cc
]
This patch fixes a missing endian conversion in
vle_get_logical_extent_head.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
92db94fa51
commit
19527c628c
1 changed files with 5 additions and 3 deletions
|
@ -1490,6 +1490,7 @@ static erofs_off_t vle_get_logical_extent_head(
|
|||
unsigned long long ofs;
|
||||
const unsigned int clusterbits = EROFS_SB(inode->i_sb)->clusterbits;
|
||||
const unsigned int clustersize = 1 << clusterbits;
|
||||
unsigned int delta0;
|
||||
|
||||
if (page->index != blkaddr) {
|
||||
kunmap_atomic(*kaddr_iter);
|
||||
|
@ -1504,12 +1505,13 @@ static erofs_off_t vle_get_logical_extent_head(
|
|||
di = *kaddr_iter + vle_extent_blkoff(inode, lcn);
|
||||
switch (vle_cluster_type(di)) {
|
||||
case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD:
|
||||
BUG_ON(!di->di_u.delta[0]);
|
||||
BUG_ON(lcn < di->di_u.delta[0]);
|
||||
delta0 = le16_to_cpu(di->di_u.delta[0]);
|
||||
DBG_BUGON(!delta0);
|
||||
DBG_BUGON(lcn < delta0);
|
||||
|
||||
ofs = vle_get_logical_extent_head(inode,
|
||||
page_iter, kaddr_iter,
|
||||
lcn - di->di_u.delta[0], pcn, flags);
|
||||
lcn - delta0, pcn, flags);
|
||||
break;
|
||||
case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:
|
||||
*flags ^= EROFS_MAP_ZIPPED;
|
||||
|
|
Loading…
Reference in a new issue