From: Maxim Korotkov Date: Thu, 19 Jan 2023 10:44:43 +0000 (+0300) Subject: writeback: fix call of incorrect macro X-Git-Tag: v6.4-rc1~13^2~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3e46c89c74f2c38e5337d2cf44b0b551adff1cb4;p=tomoyo%2Ftomoyo-test1.git writeback: fix call of incorrect macro the variable 'history' is of type u16, it may be an error that the hweight32 macro was used for it I guess macro hweight16 should be used Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2a81490811d0 ("writeback: implement foreign cgroup inode detection") Signed-off-by: Maxim Korotkov Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230119104443.3002-1-korotkov.maxim.s@gmail.com Signed-off-by: Jens Axboe --- diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 195dc23e0d83..6faeb45234ed 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -829,7 +829,7 @@ void wbc_detach_inode(struct writeback_control *wbc) * is okay. The main goal is avoiding keeping an inode on * the wrong wb for an extended period of time. */ - if (hweight32(history) > WB_FRN_HIST_THR_SLOTS) + if (hweight16(history) > WB_FRN_HIST_THR_SLOTS) inode_switch_wbs(inode, max_id); }