diff mbox series

btrfs: remove duplicate recording of physical address

Message ID 022e1767f333e36d22e0c6f859334ae9433e42a4.1705487315.git.johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs: remove duplicate recording of physical address | expand

Commit Message

Johannes Thumshirn Jan. 17, 2024, 10:30 a.m. UTC
Remove the duplicate physical recording of the original write physical
address in case of a single device write.

This duplicated code is most likely present due to a rebase error.

Fixes: 02c372e1f016e ("btrfs: add support for inserting raid stripe extents")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/bio.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Filipe Manana Jan. 17, 2024, 11:36 a.m. UTC | #1
On Wed, Jan 17, 2024 at 10:34 AM Johannes Thumshirn
<johannes.thumshirn@wdc.com> wrote:
>
> Remove the duplicate physical recording of the original write physical
> address in case of a single device write.
>
> This duplicated code is most likely present due to a rebase error.
>
> Fixes: 02c372e1f016e ("btrfs: add support for inserting raid stripe extents")

The Fixes tag is meant to be used for bug fixes or significant
performance regressions,
but this is just removing a redundant piece of code that doesn't cause
any of those problems.
With such a tag, an unnecessary stable backport will happen automatically.

> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Anyway, apart from the unnecessary tag, it looks good.

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Thanks.

> ---
>  fs/btrfs/bio.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
> index 928f512cdb4a..2d20215548db 100644
> --- a/fs/btrfs/bio.c
> +++ b/fs/btrfs/bio.c
> @@ -509,8 +509,6 @@ static void __btrfs_submit_bio(struct bio *bio, struct btrfs_io_context *bioc,
>         if (!bioc) {
>                 /* Single mirror read/write fast path. */
>                 btrfs_bio(bio)->mirror_num = mirror_num;
> -               if (bio_op(bio) != REQ_OP_READ)
> -                       btrfs_bio(bio)->orig_physical = smap->physical;
>                 bio->bi_iter.bi_sector = smap->physical >> SECTOR_SHIFT;
>                 if (bio_op(bio) != REQ_OP_READ)
>                         btrfs_bio(bio)->orig_physical = smap->physical;
> --
> 2.43.0
>
>
Johannes Thumshirn Jan. 17, 2024, 11:42 a.m. UTC | #2
On 17.01.24 12:36, Filipe Manana wrote:
> On Wed, Jan 17, 2024 at 10:34 AM Johannes Thumshirn
> <johannes.thumshirn@wdc.com> wrote:
>>
>> Remove the duplicate physical recording of the original write physical
>> address in case of a single device write.
>>
>> This duplicated code is most likely present due to a rebase error.
>>
>> Fixes: 02c372e1f016e ("btrfs: add support for inserting raid stripe extents")
> 
> The Fixes tag is meant to be used for bug fixes or significant
> performance regressions,
> but this is just removing a redundant piece of code that doesn't cause
> any of those problems.
> With such a tag, an unnecessary stable backport will happen automatically.
> 
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> Anyway, apart from the unnecessary tag, it looks good.
> 
> Reviewed-by: Filipe Manana <fdmanana@suse.com>

Ok removed the fixes tag.

@Dave I'll take this trivial patch as a first example of committing myself.
David Sterba Jan. 17, 2024, 5:02 p.m. UTC | #3
On Wed, Jan 17, 2024 at 11:42:26AM +0000, Johannes Thumshirn wrote:
> On 17.01.24 12:36, Filipe Manana wrote:
> > On Wed, Jan 17, 2024 at 10:34 AM Johannes Thumshirn
> > <johannes.thumshirn@wdc.com> wrote:
> >>
> >> Remove the duplicate physical recording of the original write physical
> >> address in case of a single device write.
> >>
> >> This duplicated code is most likely present due to a rebase error.
> >>
> >> Fixes: 02c372e1f016e ("btrfs: add support for inserting raid stripe extents")
> > 
> > The Fixes tag is meant to be used for bug fixes or significant
> > performance regressions,
> > but this is just removing a redundant piece of code that doesn't cause
> > any of those problems.
> > With such a tag, an unnecessary stable backport will happen automatically.
> > 
> >> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > 
> > Anyway, apart from the unnecessary tag, it looks good.
> > 
> > Reviewed-by: Filipe Manana <fdmanana@suse.com>
> 
> Ok removed the fixes tag.
> 
> @Dave I'll take this trivial patch as a first example of committing myself.

Sure,

Reviewed-by: David Sterba <dsterba@suse.com>
diff mbox series

Patch

diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index 928f512cdb4a..2d20215548db 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -509,8 +509,6 @@  static void __btrfs_submit_bio(struct bio *bio, struct btrfs_io_context *bioc,
 	if (!bioc) {
 		/* Single mirror read/write fast path. */
 		btrfs_bio(bio)->mirror_num = mirror_num;
-		if (bio_op(bio) != REQ_OP_READ)
-			btrfs_bio(bio)->orig_physical = smap->physical;
 		bio->bi_iter.bi_sector = smap->physical >> SECTOR_SHIFT;
 		if (bio_op(bio) != REQ_OP_READ)
 			btrfs_bio(bio)->orig_physical = smap->physical;