diff mbox

[next] Btrfs: fix comparison in __btrfs_map_block()

Message ID 1468595001-4270-1-git-send-email-vincent.stehle@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Vincent Stehlé July 15, 2016, 3:03 p.m. UTC
Add missing comparison to op in expression, which was forgotten when doing
the REQ_OP transition.

Fixes: b3d3fa519905 ("btrfs: update __btrfs_map_block for REQ_OP transition")
Signed-off-by: Vincent Stehlé <vincent.stehle@intel.com>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Jens Axboe <axboe@fb.com>
---


Hi,

I saw that issue in linux next.

Not sure if it is too late to squash the fix with commit b3d3fa519905 or
not...

Best regards,

Vincent.


 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Christie July 17, 2016, 8:51 p.m. UTC | #1
On 07/15/2016 10:03 AM, Vincent Stehlé wrote:
> Add missing comparison to op in expression, which was forgotten when doing
> the REQ_OP transition.
> 
> Fixes: b3d3fa519905 ("btrfs: update __btrfs_map_block for REQ_OP transition")
> Signed-off-by: Vincent Stehlé <vincent.stehle@intel.com>
> Cc: Mike Christie <mchristi@redhat.com>
> Cc: Jens Axboe <axboe@fb.com>
> ---
> 
> 
> Hi,
> 
> I saw that issue in linux next.
> 
> Not sure if it is too late to squash the fix with commit b3d3fa519905 or
> not...
> 
> Best regards,
> 
> Vincent.
> 
> 
>  fs/btrfs/volumes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index a69203a..6ee1e36 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -5533,7 +5533,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int op,
>  		}
>  
>  	} else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
> -		if (op == REQ_OP_WRITE || REQ_OP_DISCARD ||
> +		if (op == REQ_OP_WRITE || op == REQ_OP_DISCARD ||
>  		    op == REQ_GET_READ_MIRRORS) {
>  			num_stripes = map->num_stripes;
>  		} else if (mirror_num) {
> 


Shoot. Dumb mistake by me. It is of course correct.

Reviewed-by: Mike Christie <mchristi@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig July 18, 2016, 3:50 a.m. UTC | #2
On Sun, Jul 17, 2016 at 03:51:03PM -0500, Mike Christie wrote:
> > 
> > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> > index a69203a..6ee1e36 100644
> > --- a/fs/btrfs/volumes.c
> > +++ b/fs/btrfs/volumes.c
> > @@ -5533,7 +5533,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int op,
> >  		}
> >  
> >  	} else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
> > -		if (op == REQ_OP_WRITE || REQ_OP_DISCARD ||
> > +		if (op == REQ_OP_WRITE || op == REQ_OP_DISCARD ||
> >  		    op == REQ_GET_READ_MIRRORS) {
> >  			num_stripes = map->num_stripes;
> >  		} else if (mirror_num) {
> > 
> 
> 
> Shoot. Dumb mistake by me. It is of course correct.

Ad while we're at it we need to fix up that REQ_GET_READ_MIRRORS thing.
Overloading the op localally in a fs is going to create problems sooner
or later as no one touching the generic values and/or the code
mashalling it in different forms knows about it.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jens Axboe July 18, 2016, 9:28 p.m. UTC | #3
On 07/15/2016 09:03 AM, Vincent Stehlé wrote:
> Add missing comparison to op in expression, which was forgotten when doing
> the REQ_OP transition.

Thanks, added to the 4.8 branch.
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a69203a..6ee1e36 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5533,7 +5533,7 @@  static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int op,
 		}
 
 	} else if (map->type & BTRFS_BLOCK_GROUP_DUP) {
-		if (op == REQ_OP_WRITE || REQ_OP_DISCARD ||
+		if (op == REQ_OP_WRITE || op == REQ_OP_DISCARD ||
 		    op == REQ_GET_READ_MIRRORS) {
 			num_stripes = map->num_stripes;
 		} else if (mirror_num) {