summary refs log tree commit diff
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorMaxim Korotkov <korotkov.maxim.s@gmail.com>2023-01-19 13:44:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 11:53:33 +0200
commit7c4c6e2a40757d7697541ebbb1a8f77919abb879 (patch)
tree9ac055c3d287e8d7a1f4f8bfd599ee6d0d8b6bee /fs/fs-writeback.c
parent5ac2914f67c8707c5d168fd3728bc5afc6df9798 (diff)
downloadlinux-7c4c6e2a40757d7697541ebbb1a8f77919abb879.tar.gz
writeback: fix call of incorrect macro
[ Upstream commit 3e46c89c74f2c38e5337d2cf44b0b551adff1cb4 ]

 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 <korotkov.maxim.s@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230119104443.3002-1-korotkov.maxim.s@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index aa33c39be182..d387708977a5 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -827,7 +827,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);
 	}