* [PATCH] bcachefs: Remove duplicate condition in return statement
@ 2025-02-22 13:31 Thorsten Blum
2025-02-22 14:05 ` Kent Overstreet
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Blum @ 2025-02-22 13:31 UTC (permalink / raw)
To: Kent Overstreet; +Cc: Thorsten Blum, linux-bcachefs, linux-kernel
The last two conditions in the return statement are identical. Remove
one of them.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
fs/bcachefs/extents.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 620b284aa34f..8afcf2c75015 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -703,7 +703,6 @@ static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
return (ptr1.cached == ptr2.cached &&
ptr1.unwritten == ptr2.unwritten &&
ptr1.offset == ptr2.offset &&
- ptr1.dev == ptr2.dev &&
ptr1.dev == ptr2.dev);
}
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bcachefs: Remove duplicate condition in return statement
2025-02-22 13:31 [PATCH] bcachefs: Remove duplicate condition in return statement Thorsten Blum
@ 2025-02-22 14:05 ` Kent Overstreet
2025-02-22 14:16 ` Thorsten Blum
0 siblings, 1 reply; 3+ messages in thread
From: Kent Overstreet @ 2025-02-22 14:05 UTC (permalink / raw)
To: Thorsten Blum; +Cc: linux-bcachefs, linux-kernel
On Sat, Feb 22, 2025 at 02:31:01PM +0100, Thorsten Blum wrote:
> The last two conditions in the return statement are identical. Remove
> one of them.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> fs/bcachefs/extents.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
> index 620b284aa34f..8afcf2c75015 100644
> --- a/fs/bcachefs/extents.h
> +++ b/fs/bcachefs/extents.h
> @@ -703,7 +703,6 @@ static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
> return (ptr1.cached == ptr2.cached &&
> ptr1.unwritten == ptr2.unwritten &&
> ptr1.offset == ptr2.offset &&
> - ptr1.dev == ptr2.dev &&
> ptr1.dev == ptr2.dev);
Actually should have been checking gen:
From b0e5e78f7e890c48b69e24d19e82597daa2d9cf0 Mon Sep 17 00:00:00 2001
From: Kent Overstreet <kent.overstreet@linux.dev>
Date: Sat, 22 Feb 2025 09:05:36 -0500
Subject: [PATCH] bcachefs: fix bch2_extent_ptr_eq()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 8fae6b23a341..ed160aaa9546 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -704,7 +704,7 @@ static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
ptr1.unwritten == ptr2.unwritten &&
ptr1.offset == ptr2.offset &&
ptr1.dev == ptr2.dev &&
- ptr1.dev == ptr2.dev);
+ ptr1.gen == ptr2.gen);
}
void bch2_ptr_swab(struct bkey_s);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bcachefs: Remove duplicate condition in return statement
2025-02-22 14:05 ` Kent Overstreet
@ 2025-02-22 14:16 ` Thorsten Blum
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-02-22 14:16 UTC (permalink / raw)
To: Kent Overstreet; +Cc: linux-bcachefs, linux-kernel
On 22. Feb 2025, at 15:05, Kent Overstreet wrote:
> On Sat, Feb 22, 2025 at 02:31:01PM +0100, Thorsten Blum wrote:
>> The last two conditions in the return statement are identical. Remove
>> one of them.
>>
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
>> fs/bcachefs/extents.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
>> index 620b284aa34f..8afcf2c75015 100644
>> --- a/fs/bcachefs/extents.h
>> +++ b/fs/bcachefs/extents.h
>> @@ -703,7 +703,6 @@ static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
>> return (ptr1.cached == ptr2.cached &&
>> ptr1.unwritten == ptr2.unwritten &&
>> ptr1.offset == ptr2.offset &&
>> - ptr1.dev == ptr2.dev &&
>> ptr1.dev == ptr2.dev);
>>
> Actually should have been checking gen:
>
>
> From b0e5e78f7e890c48b69e24d19e82597daa2d9cf0 Mon Sep 17 00:00:00 2001
> From: Kent Overstreet <kent.overstreet@linux.dev>
> Date: Sat, 22 Feb 2025 09:05:36 -0500
> Subject: [PATCH] bcachefs: fix bch2_extent_ptr_eq()
>
> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
> diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
> index 8fae6b23a341..ed160aaa9546 100644
> --- a/fs/bcachefs/extents.h
> +++ b/fs/bcachefs/extents.h
> @@ -704,7 +704,7 @@ static inline bool bch2_extent_ptr_eq(struct bch_extent_ptr ptr1,
> ptr1.unwritten == ptr2.unwritten &&
> ptr1.offset == ptr2.offset &&
> ptr1.dev == ptr2.dev &&
> - ptr1.dev == ptr2.dev);
> + ptr1.gen == ptr2.gen);
> }
>
> void bch2_ptr_swab(struct bkey_s);
Thanks, I was about to ask if it should have been gen instead.
Feel free to add:
Reviewed-by: Thorsten Blum <thorsten.blum@linux.dev>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-22 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-22 13:31 [PATCH] bcachefs: Remove duplicate condition in return statement Thorsten Blum
2025-02-22 14:05 ` Kent Overstreet
2025-02-22 14:16 ` Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox