linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rdb: convert all rbd_assert(0) to BUG()
@ 2019-03-22 16:53 Arnd Bergmann
  2019-03-25 11:12 ` Ilya Dryomov
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-03-22 16:53 UTC (permalink / raw)
  To: Ilya Dryomov, Sage Weil, Alex Elder, Jens Axboe
  Cc: Arnd Bergmann, Jason Dillaman, ceph-devel, linux-block, linux-kernel

rbd_assert(0) has caused different issues depending on
the compiler version in the past, so it seems better to avoid it
completely.

Replace the remaining instances.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/block/rbd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index cbcc3baf3807..564c5069cc78 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1342,7 +1342,7 @@ static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
 		zero_bvecs(&obj_req->bvec_pos, off, bytes);
 		break;
 	default:
-		rbd_assert(0);
+		BUG();
 	}
 }
 
@@ -1597,7 +1597,7 @@ static void rbd_obj_request_destroy(struct kref *kref)
 		kfree(obj_request->bvec_pos.bvecs);
 		break;
 	default:
-		rbd_assert(0);
+		BUG();
 	}
 
 	kfree(obj_request->img_extents);
@@ -1797,7 +1797,7 @@ static void rbd_osd_req_setup_data(struct rbd_obj_request *obj_req, u32 which)
 						    &obj_req->bvec_pos);
 		break;
 	default:
-		rbd_assert(0);
+		BUG();
 	}
 }
 
@@ -2052,7 +2052,7 @@ static int __rbd_img_fill_request(struct rbd_img_request *img_req)
 			ret = rbd_obj_setup_zeroout(obj_req);
 			break;
 		default:
-			rbd_assert(0);
+			BUG();
 		}
 		if (ret < 0)
 			return ret;
@@ -2531,7 +2531,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
 		num_osd_ops += count_zeroout_ops(obj_req);
 		break;
 	default:
-		rbd_assert(0);
+		BUG();
 	}
 
 	obj_req->osd_req = rbd_osd_req_create(obj_req, num_osd_ops);
@@ -2558,7 +2558,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
 		__rbd_obj_setup_zeroout(obj_req, which);
 		break;
 	default:
-		rbd_assert(0);
+		BUG();
 	}
 
 	ret = ceph_osdc_alloc_messages(obj_req->osd_req, GFP_NOIO);
-- 
2.20.0


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

* Re: [PATCH] rdb: convert all rbd_assert(0) to BUG()
  2019-03-22 16:53 [PATCH] rdb: convert all rbd_assert(0) to BUG() Arnd Bergmann
@ 2019-03-25 11:12 ` Ilya Dryomov
  0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2019-03-25 11:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sage Weil, Alex Elder, Jens Axboe, Jason Dillaman,
	Ceph Development, linux-block, LKML

On Fri, Mar 22, 2019 at 5:54 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> rbd_assert(0) has caused different issues depending on
> the compiler version in the past, so it seems better to avoid it
> completely.
>
> Replace the remaining instances.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/block/rbd.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index cbcc3baf3807..564c5069cc78 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1342,7 +1342,7 @@ static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
>                 zero_bvecs(&obj_req->bvec_pos, off, bytes);
>                 break;
>         default:
> -               rbd_assert(0);
> +               BUG();
>         }
>  }
>
> @@ -1597,7 +1597,7 @@ static void rbd_obj_request_destroy(struct kref *kref)
>                 kfree(obj_request->bvec_pos.bvecs);
>                 break;
>         default:
> -               rbd_assert(0);
> +               BUG();
>         }
>
>         kfree(obj_request->img_extents);
> @@ -1797,7 +1797,7 @@ static void rbd_osd_req_setup_data(struct rbd_obj_request *obj_req, u32 which)
>                                                     &obj_req->bvec_pos);
>                 break;
>         default:
> -               rbd_assert(0);
> +               BUG();
>         }
>  }
>
> @@ -2052,7 +2052,7 @@ static int __rbd_img_fill_request(struct rbd_img_request *img_req)
>                         ret = rbd_obj_setup_zeroout(obj_req);
>                         break;
>                 default:
> -                       rbd_assert(0);
> +                       BUG();
>                 }
>                 if (ret < 0)
>                         return ret;
> @@ -2531,7 +2531,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
>                 num_osd_ops += count_zeroout_ops(obj_req);
>                 break;
>         default:
> -               rbd_assert(0);
> +               BUG();
>         }
>
>         obj_req->osd_req = rbd_osd_req_create(obj_req, num_osd_ops);
> @@ -2558,7 +2558,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
>                 __rbd_obj_setup_zeroout(obj_req, which);
>                 break;
>         default:
> -               rbd_assert(0);
> +               BUG();
>         }
>
>         ret = ceph_osdc_alloc_messages(obj_req->osd_req, GFP_NOIO);

Applied.

Thanks,

                Ilya

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

end of thread, other threads:[~2019-03-25 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 16:53 [PATCH] rdb: convert all rbd_assert(0) to BUG() Arnd Bergmann
2019-03-25 11:12 ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).