linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] writeback: fix call of incorrect macro
@ 2023-01-19 10:44 Maxim Korotkov
  2023-01-26 13:52 ` Jan Kara
  2023-04-28 16:42 ` Jens Axboe
  0 siblings, 2 replies; 5+ messages in thread
From: Maxim Korotkov @ 2023-01-19 10:44 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Maxim Korotkov, Jens Axboe, Tejun Heo, linux-fsdevel,
	linux-kernel, lvc-project

 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(-)

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] writeback: fix call of incorrect macro
  2023-01-19 10:44 [PATCH] writeback: fix call of incorrect macro Maxim Korotkov
@ 2023-01-26 13:52 ` Jan Kara
  2023-04-12 14:31   ` Maxim Korotkov
  2023-04-28 16:42 ` Jens Axboe
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kara @ 2023-01-26 13:52 UTC (permalink / raw)
  To: Maxim Korotkov
  Cc: Alexander Viro, Jens Axboe, Tejun Heo, linux-fsdevel,
	linux-kernel, lvc-project

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
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] writeback: fix call of incorrect macro
  2023-01-26 13:52 ` Jan Kara
@ 2023-04-12 14:31   ` Maxim Korotkov
  2023-04-28 13:09     ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Korotkov @ 2023-04-12 14:31 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Jan Kara, Jens Axboe, Tejun Heo, linux-fsdevel, linux-kernel,
	lvc-project

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
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] writeback: fix call of incorrect macro
  2023-04-12 14:31   ` Maxim Korotkov
@ 2023-04-28 13:09     ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2023-04-28 13:09 UTC (permalink / raw)
  To: Maxim Korotkov
  Cc: Alexander Viro, Jan Kara, Jens Axboe, Tejun Heo, linux-fsdevel,
	linux-kernel, lvc-project

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
> > > 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] writeback: fix call of incorrect macro
  2023-01-19 10:44 [PATCH] writeback: fix call of incorrect macro Maxim Korotkov
  2023-01-26 13:52 ` Jan Kara
@ 2023-04-28 16:42 ` Jens Axboe
  1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2023-04-28 16:42 UTC (permalink / raw)
  To: Alexander Viro, Maxim Korotkov
  Cc: Jens Axboe, Tejun Heo, linux-fsdevel, linux-kernel, lvc-project


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,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-28 16:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19 10:44 [PATCH] writeback: fix call of incorrect macro Maxim Korotkov
2023-01-26 13:52 ` Jan Kara
2023-04-12 14:31   ` Maxim Korotkov
2023-04-28 13:09     ` Jan Kara
2023-04-28 16:42 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).