summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDing Xiang <dingxiang@cmss.chinamobile.com>2022-05-30 18:00:47 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-25 11:49:17 +0200
commitc86fce1d8c083d268103d2d19e5a9a66000a8e6f (patch)
treee74b2ca92476cb073c38f8dd1d3201fdee9da4ec
parentext4: fix bug_on ext4_mb_use_inode_pa (diff)
downloadlinux-stable-c86fce1d8c083d268103d2d19e5a9a66000a8e6f.tar.xz
linux-stable-c86fce1d8c083d268103d2d19e5a9a66000a8e6f.zip
ext4: make variable "count" signed
commit bc75a6eb856cb1507fa907bf6c1eda91b3fef52f upstream. Since dx_make_map() may return -EFSCORRUPTED now, so change "count" to be a signed integer so we can correctly check for an error code returned by dx_make_map(). Fixes: 46c116b920eb ("ext4: verify dir block before splitting it") Cc: stable@kernel.org Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20220530100047.537598-1-dingxiang@cmss.chinamobile.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/namei.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 621271c2989b..5f8599419150 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1743,7 +1743,8 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
struct dx_hash_info *hinfo)
{
unsigned blocksize = dir->i_sb->s_blocksize;
- unsigned count, continued;
+ unsigned continued;
+ int count;
struct buffer_head *bh2;
ext4_lblk_t newblock;
u32 hash2;