OSDN Git Service

staging: erofs: fix compression mapping beyond EOF
authorGao Xiang <gaoxiang25@huawei.com>
Tue, 21 Aug 2018 14:49:36 +0000 (22:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2018 17:46:13 +0000 (19:46 +0200)
Logical address of EOF LTP mapping should start at
`inode->i_size' rather than `inode->i_size - 1' to
`m_la(in)', fix it.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c

index dab8921..6c4c928 100644 (file)
@@ -1548,7 +1548,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
        if (unlikely(map->m_la >= inode->i_size)) {
                BUG_ON(!initial);
                map->m_llen = map->m_la + 1 - inode->i_size;
-               map->m_la = inode->i_size - 1;
+               map->m_la = inode->i_size;
                map->m_flags = 0;
                goto out;
        }