All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter
@ 2020-04-07 10:38 fdmanana
  2020-04-07 11:32 ` Nikolay Borisov
  2020-04-08 17:19 ` David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: fdmanana @ 2020-04-07 10:38 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

The reclaim_size counter of a space_info object is unsigned. So its value
can never be negative, it's pointless to have an assertion that checks
its value is >= 0, therefore remove it.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/space-info.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index ff17a4420358..88d7dea215ff 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -1198,7 +1198,6 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
 	 * the list and we will do our own flushing further down.
 	 */
 	if (ret && flush != BTRFS_RESERVE_NO_FLUSH) {
-		ASSERT(space_info->reclaim_size >= 0);
 		ticket.bytes = orig_bytes;
 		ticket.error = 0;
 		space_info->reclaim_size += ticket.bytes;
-- 
2.11.0


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

* Re: [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter
  2020-04-07 10:38 [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter fdmanana
@ 2020-04-07 11:32 ` Nikolay Borisov
  2020-04-07 14:14   ` Filipe Manana
  2020-04-08 17:19 ` David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: Nikolay Borisov @ 2020-04-07 11:32 UTC (permalink / raw)
  To: fdmanana, linux-btrfs



On 7.04.20 г. 13:38 ч., fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The reclaim_size counter of a space_info object is unsigned. So its value
> can never be negative, it's pointless to have an assertion that checks
> its value is >= 0, therefore remove it.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

True,

Reviewed-by: Nikolay Borisov <nborisov@suse.com> I guess this could be
squashed.

> ---
>  fs/btrfs/space-info.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> index ff17a4420358..88d7dea215ff 100644
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -1198,7 +1198,6 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
>  	 * the list and we will do our own flushing further down.
>  	 */
>  	if (ret && flush != BTRFS_RESERVE_NO_FLUSH) {
> -		ASSERT(space_info->reclaim_size >= 0);
>  		ticket.bytes = orig_bytes;
>  		ticket.error = 0;
>  		space_info->reclaim_size += ticket.bytes;
> 

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

* Re: [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter
  2020-04-07 11:32 ` Nikolay Borisov
@ 2020-04-07 14:14   ` Filipe Manana
  2020-04-07 15:01     ` Nikolay Borisov
  0 siblings, 1 reply; 5+ messages in thread
From: Filipe Manana @ 2020-04-07 14:14 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

On Tue, Apr 7, 2020 at 12:32 PM Nikolay Borisov <nborisov@suse.com> wrote:
>
>
>
> On 7.04.20 г. 13:38 ч., fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > The reclaim_size counter of a space_info object is unsigned. So its value
> > can never be negative, it's pointless to have an assertion that checks
> > its value is >= 0, therefore remove it.
> >
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
>
> True,
>
> Reviewed-by: Nikolay Borisov <nborisov@suse.com> I guess this could be
> squashed.

Despite being a trivial and small change, I don't think it should be
squashed into the previous patch, as it's not part of the bug fix
regarding the counter leak.
Different changes and unrelated changes should be separate patches.

Thanks.

>
> > ---
> >  fs/btrfs/space-info.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> > index ff17a4420358..88d7dea215ff 100644
> > --- a/fs/btrfs/space-info.c
> > +++ b/fs/btrfs/space-info.c
> > @@ -1198,7 +1198,6 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
> >        * the list and we will do our own flushing further down.
> >        */
> >       if (ret && flush != BTRFS_RESERVE_NO_FLUSH) {
> > -             ASSERT(space_info->reclaim_size >= 0);
> >               ticket.bytes = orig_bytes;
> >               ticket.error = 0;
> >               space_info->reclaim_size += ticket.bytes;
> >

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

* Re: [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter
  2020-04-07 14:14   ` Filipe Manana
@ 2020-04-07 15:01     ` Nikolay Borisov
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolay Borisov @ 2020-04-07 15:01 UTC (permalink / raw)
  To: Filipe Manana; +Cc: linux-btrfs



On 7.04.20 г. 17:14 ч., Filipe Manana wrote:
> On Tue, Apr 7, 2020 at 12:32 PM Nikolay Borisov <nborisov@suse.com> wrote:
>>
>>
>>
>> On 7.04.20 г. 13:38 ч., fdmanana@kernel.org wrote:
>>> From: Filipe Manana <fdmanana@suse.com>
>>>
>>> The reclaim_size counter of a space_info object is unsigned. So its value
>>> can never be negative, it's pointless to have an assertion that checks
>>> its value is >= 0, therefore remove it.
>>>
>>> Signed-off-by: Filipe Manana <fdmanana@suse.com>
>>
>> True,
>>
>> Reviewed-by: Nikolay Borisov <nborisov@suse.com> I guess this could be
>> squashed.
> 
> Despite being a trivial and small change, I don't think it should be
> squashed into the previous patch, as it's not part of the bug fix
> regarding the counter leak.
> Different changes and unrelated changes should be separate patches.

I meant to say squashed into the original commit that introduced the
assert but it seems it has already been merged into master so yeah, it
will go as it is.


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

* Re: [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter
  2020-04-07 10:38 [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter fdmanana
  2020-04-07 11:32 ` Nikolay Borisov
@ 2020-04-08 17:19 ` David Sterba
  1 sibling, 0 replies; 5+ messages in thread
From: David Sterba @ 2020-04-08 17:19 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Tue, Apr 07, 2020 at 11:38:58AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The reclaim_size counter of a space_info object is unsigned. So its value
> can never be negative, it's pointless to have an assertion that checks
> its value is >= 0, therefore remove it.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

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

end of thread, other threads:[~2020-04-08 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 10:38 [PATCH 2/2] Btrfs: remove pointless assertion on reclaim_size counter fdmanana
2020-04-07 11:32 ` Nikolay Borisov
2020-04-07 14:14   ` Filipe Manana
2020-04-07 15:01     ` Nikolay Borisov
2020-04-08 17:19 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.