diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-08-19 18:34:22 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 15:12:22 +0200 |
commit | ea82e3cf540a1c28721a3a880e1f1f7f8adb330b (patch) | |
tree | 4264f51353f13fb7ae57b9ff3f9caaac357fdb13 /drivers/staging/erofs/zmap.c | |
parent | 4115a85b27909bdf5d6f8be07602ca9be5ee1f92 (diff) | |
download | linux-stable-ea82e3cf540a1c28721a3a880e1f1f7f8adb330b.tar.gz linux-stable-ea82e3cf540a1c28721a3a880e1f1f7f8adb330b.tar.bz2 linux-stable-ea82e3cf540a1c28721a3a880e1f1f7f8adb330b.zip |
staging: erofs: cannot set EROFS_V_Z_INITED_BIT if fill_inode_lazy fails
commit 3407a4198faf01c9d7596c45b8606834b8dfc2b7 upstream.
As reported by erofs-utils fuzzer, unsupported compressed
clustersize will make fill_inode_lazy fail, for such case
we cannot set EROFS_V_Z_INITED_BIT since we need return
failure for each z_erofs_map_blocks_iter().
Fixes: 152a333a5895 ("staging: erofs: add compacted compression indexes support")
Cc: <stable@vger.kernel.org> # 5.3+
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190819103426.87579-3-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/zmap.c')
-rw-r--r-- | drivers/staging/erofs/zmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/erofs/zmap.c b/drivers/staging/erofs/zmap.c index 9c0bd65c46bf..c2359321ca13 100644 --- a/drivers/staging/erofs/zmap.c +++ b/drivers/staging/erofs/zmap.c @@ -86,12 +86,11 @@ static int fill_inode_lazy(struct inode *inode) vi->z_physical_clusterbits[1] = vi->z_logical_clusterbits + ((h->h_clusterbits >> 5) & 7); + set_bit(EROFS_V_Z_INITED_BIT, &vi->flags); unmap_done: kunmap_atomic(kaddr); unlock_page(page); put_page(page); - - set_bit(EROFS_V_Z_INITED_BIT, &vi->flags); out_unlock: clear_and_wake_up_bit(EROFS_V_BL_Z_BIT, &vi->flags); return err; |