Btrfs: remove pointless assertion on reclaim_size counter
PATCH 2/2 Btrfs: remove pointless assertion on reclaim_size counter
From: Filipe Manana <[email protected]>
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.
--- fs/btrfs/space-info.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/space-info.c +0 -1
@@ -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;
Signature · 1 line
2.11.0
Quoted 7 lines · On 7.04.20 г. 13:38 ч., [email protected] wrote:
From: Filipe Manana <[email protected]>
The
reclaim_sizecounter of aspace_infoobject 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 <[email protected]>
True,
squashed.
Quoted 17 lines
--- fs/btrfs/space-info.c | 1 - 1 file changed, 1 deletion(-)fs/btrfs/space-info.c +0
-1@@ -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;
Quoted 10 lines · Nikolay Borisov
Quoted 6 lines · On 7.04.20 г. 13:38 ч., [email protected] wrote:
From: Filipe Manana <[email protected]>
The
reclaim_sizecounter of aspace_infoobject 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.
Quoted 6 lines
Quoted 1 line
Signed-off-by Filipe Manana <[email protected]>True,
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.
Quoted 18 lines
Quoted 18 lines
--- fs/btrfs/space-info.c | 1 - 1 file changed, 1 deletion(-)fs/btrfs/space-info.c +0
-1@@ -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;
Quoted 15 lines · Filipe Manana
Quoted 14 lines · Nikolay Borisov
Quoted 7 lines · On 7.04.20 г. 13:38 ч., [email protected] wrote:
From: Filipe Manana <[email protected]>
The
reclaim_sizecounter of aspace_infoobject 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 <[email protected]>True,
Quoted 7 lines
Quoted 2 lines
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.
Quoted 7 lines · On Tue, Apr 07, 2020 at 11:38:58AM +0100, [email protected] wrote:
From: Filipe Manana <[email protected]>
The
reclaim_sizecounter of aspace_infoobject 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 <[email protected]>
Added to misc-next, thanks.