From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7F1BC77B7D for ; Mon, 15 May 2023 17:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233959AbjEORaC (ORCPT ); Mon, 15 May 2023 13:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244157AbjEOR3T (ORCPT ); Mon, 15 May 2023 13:29:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E1C7AB3 for ; Mon, 15 May 2023 10:27:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0350062D0C for ; Mon, 15 May 2023 17:27:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F229FC433D2; Mon, 15 May 2023 17:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684171619; bh=UTDCAJ6RJpss4uH3VmARSo4XGTFYoMMAyTS0b72q6os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1F2CfDzjtFNpudkV6OuYyzyHqFGSCUeaDr7AmAVHjL/nTm4os3s8GdlBR8P2ny8oA L62tt3cSgqvEHdqtf1PzFZmJ60GwUBSbxUjk2TTAmY45pekNj+Qo1bBMeo+C/tU9sR /ud/1YdBeu8eDMAqnl36oTPu5aIbxML+ZR0yDK/U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maxim Korotkov , Jan Kara , Jens Axboe , Sasha Levin Subject: [PATCH 5.15 025/134] writeback: fix call of incorrect macro Date: Mon, 15 May 2023 18:28:22 +0200 Message-Id: <20230515161703.868677270@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161702.887638251@linuxfoundation.org> References: <20230515161702.887638251@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Maxim Korotkov [ 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 Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230119104443.3002-1-korotkov.maxim.s@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/fs-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index fbc3f0ef38c02..c76537a6826a7 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -825,7 +825,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); } -- 2.39.2