Message ID | 20230119104443.3002-1-korotkov.maxim.s@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp260878wrn; Thu, 19 Jan 2023 03:01:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRKezCmt6j/rsIGertih4sdUe5YSL/Z+ek7aTv/VnTAIOYWQmnBST/Z79IMVF0/QvkOkyJ X-Received: by 2002:aa7:8484:0:b0:58d:f209:da0b with SMTP id u4-20020aa78484000000b0058df209da0bmr3484044pfn.22.1674126092486; Thu, 19 Jan 2023 03:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674126092; cv=none; d=google.com; s=arc-20160816; b=wWjeWWdUv6WiLCOmozpUhJJHd7VHMr+qWNQWQMvsLjIJQ+Sl48qKFbvtALd87Ikmnp LVSnqvLnnICDBeX7UYtxEk9G8xaicRwTeSOyjjS4B0BAXlnIkPzHqX/e9jH1EjPao/8j pgfscFyf6HPQUxUZsL9kf0zVMk6FjEkgYZRcTR7UFqOBNS9Fq96R//cJfi1jFgkyTWcn P6j16NdSpveUcPU+OBi6pynlA1PDfKV8QT+PApR92q0OL2DuhsJ0igW9TejI9N0+rdxt tyuANzOxEgmMap1Fy+y9U139DQYQikrAJ+kaz4Y4ILNCh4KTsbOztKP52i/FAjOsCSXt pxnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=i6i5x37mYZe3aOy5A75Nxb44pi0Ov9eivp98jLF4Pa0=; b=Bm9X1Qb99C77ynY6GziGpqKehjldHzADlroXQeN7a0sG5nHe5LY9fxMVIPt78G7qww +5bDTnW90LvONV/q0VctPCeGppR+M5DMQ46wDg9B68z/u4pDFGaWdi3Y3VtGcSbOLPWH P4nT+zT2UJeoTZKQ9ii6Ryak5FWNVsSPEVhQJgCBw+mKQV2htk1YDoxi54LxZP4Pqmnt qMw2tatl8uLC6mOV2dk+oORIAr4gbJpOym+eetBxnAZQzm0DZQYJR9VNwFSwpFaYuPOC 4LcWWq70DeQLhvZkFjhhmf+2zTzo8Uh6skM7a1xJ4m4+x0UDurheS3drA/E2Spc5MG46 dcvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZKCuIXK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020a056a00181700b005809ad59dddsi16680126pfa.9.2023.01.19.03.01.20; Thu, 19 Jan 2023 03:01:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZKCuIXK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjASKzH (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Thu, 19 Jan 2023 05:55:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjASKzA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Jan 2023 05:55:00 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ABF54AA76; Thu, 19 Jan 2023 02:54:56 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id o20so2658933lfk.5; Thu, 19 Jan 2023 02:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=i6i5x37mYZe3aOy5A75Nxb44pi0Ov9eivp98jLF4Pa0=; b=ZKCuIXK3VdjwQ0/R04Tz2nTKeqnbhXdCn5a7oUUQGj70vaAlHMoZrYxBuv/AehWi0R Ws4aqhRr3FJhHiOkhSjp6uOtUWmKieUo5nc2YN66b+khDvWTIce6+bG+9JlS9H80H2Zk 5ElzJuwMWU3xCpYvi+DwyrgPR3PZG2scXssB3MlhsmIRhY5njkaTPmRFzmjlMTdc3Pk3 /XZF+mAuD5qQF4mShAXs3UxeQjYKeV8xH8sbo2MvP0L68ymQyWbsT/ORJhrlANzz6ngD 41rSlMxFy7gGF//qOMRMxmCTwHmH5zbYPqXwU/5igRewVmwiqYe8ynoJ97ah6iT5YYRX ZDog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i6i5x37mYZe3aOy5A75Nxb44pi0Ov9eivp98jLF4Pa0=; b=lzynhWss1iuMpZ4ic5HDl7BrhBrcyqOJjy8netTb0eDIMf9bPcrf+jp5Tzs+zfeVJx hznTvdG0qewqMjc6DjPdB7Qh7WjcalyH4oeRe258M+ZrvcTGzuOLTweVwNJ7/JBXoplq HVRgO2E0oiFJ46m1wDRso1tbKWmQoVOBsm6wib9pY/4w6AfBYRZJN6tQIIng25TvfmBk TjWVM+N3nfOa2rln0q/pgsjRwVX2wChznxfn+dDNTlyIu7BVm6vD7pt8G10jCMLp1DBO pzhuUQwYiCQLQjNT3oM5uxIaa7TICfNGPmwbAvpM0eBBzuKkdAucgz3f9J3GeMjSGDQm hoqQ== X-Gm-Message-State: AFqh2kpT52cdcu1qwFxX2lw/xObeR9DDnYdY7mX/PGgHQ6ZgdQDcc5iO 9xxpH7vj6zn8wu52eaL82KfPgdnktp7ji17Y X-Received: by 2002:ac2:435a:0:b0:4d5:7fad:a042 with SMTP id o26-20020ac2435a000000b004d57fada042mr2311847lfl.41.1674125694887; Thu, 19 Jan 2023 02:54:54 -0800 (PST) Received: from mkor.rasu.local (95-37-60-162.dynamic.mts-nn.ru. [95.37.60.162]) by smtp.gmail.com with ESMTPSA id n22-20020a0565120ad600b004aac23e0dd6sm5878777lfu.29.2023.01.19.02.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 02:54:54 -0800 (PST) From: Maxim Korotkov <korotkov.maxim.s@gmail.com> To: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Maxim Korotkov <korotkov.maxim.s@gmail.com>, Jens Axboe <axboe@fb.com>, Tejun Heo <tj@kernel.org>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] writeback: fix call of incorrect macro Date: Thu, 19 Jan 2023 13:44:43 +0300 Message-Id: <20230119104443.3002-1-korotkov.maxim.s@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755448441425501015?= X-GMAIL-MSGID: =?utf-8?q?1755448441425501015?= |
Series |
writeback: fix call of incorrect macro
|
|
Commit Message
Maxim Korotkov
Jan. 19, 2023, 10:44 a.m. UTC
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>
---
fs/fs-writeback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu 19-01-23 13:44:43, Maxim Korotkov wrote: > 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> Looks good to me, although it is mostly a theoretical issue - I don't see how hweight32 could do any harm here. Anyway, feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > 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 6fba5a52127b..fc16123b2405 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); > } > > -- > 2.37.2 >
Hi, Will this patch be applied or rejected? best regards, Max On 26.01.2023 16:52, Jan Kara wrote: > On Thu 19-01-23 13:44:43, Maxim Korotkov wrote: >> 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> > > Looks good to me, although it is mostly a theoretical issue - I don't see > how hweight32 could do any harm here. Anyway, feel free to add: > > Reviewed-by: Jan Kara <jack@suse.cz> > > Honza > >> --- >> 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 6fba5a52127b..fc16123b2405 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); >> } >> >> -- >> 2.37.2 >>
Hi! Jens, can you please pickup this patch? It has fallen through the cracks. Usually you tend to be picking up cgroup writeback stuff. Thanks! Honza On Wed 12-04-23 17:31:03, Maxim Korotkov wrote: > Hi, > Will this patch be applied or rejected? > best regards, Max > > On 26.01.2023 16:52, Jan Kara wrote: > > On Thu 19-01-23 13:44:43, Maxim Korotkov wrote: > > > 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> > > > > Looks good to me, although it is mostly a theoretical issue - I don't see > > how hweight32 could do any harm here. Anyway, feel free to add: > > > > Reviewed-by: Jan Kara <jack@suse.cz> > > > > Honza > > > > > --- > > > 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 6fba5a52127b..fc16123b2405 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); > > > } > > > -- > > > 2.37.2 > > > >
On Thu, 19 Jan 2023 13:44:43 +0300, Maxim Korotkov wrote: > 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. > > > [...] Applied, thanks! [1/1] writeback: fix call of incorrect macro commit: 3e46c89c74f2c38e5337d2cf44b0b551adff1cb4 Best regards,
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 6fba5a52127b..fc16123b2405 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); }