From: Ilya Dryomov <idryomov@gmail.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Sage Weil <sage@redhat.com>,
Dongsheng Yang <dongsheng.yang@easystack.cn>,
Jens Axboe <axboe@kernel.dk>,
Ceph Development <ceph-devel@vger.kernel.org>,
linux-block <linux-block@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rbd: Avoid calling BUG() when object_map is not empty
Date: Mon, 16 Dec 2019 11:18:30 +0100 [thread overview]
Message-ID: <CAOi1vP_dYP05Wj1fpH-U2WLGhOBp3RmFXPvjYmjorx_MLZW6Zg@mail.gmail.com> (raw)
In-Reply-To: <20191215163527.25203-1-pakki001@umn.edu>
On Sun, Dec 15, 2019 at 5:35 PM Aditya Pakki <pakki001@umn.edu> wrote:
>
> In __rbd_object_map_load, if object_map contains data, return
> error -EINVAL upstream, instead of crashing, via BUG. The patch
> fixes this issue.
>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
> drivers/block/rbd.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 2b184563cd32..6e9a11f32a94 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1892,7 +1892,8 @@ static int __rbd_object_map_load(struct rbd_device *rbd_dev)
> int num_pages;
> int ret;
>
> - rbd_assert(!rbd_dev->object_map && !rbd_dev->object_map_size);
> + if (rbd_dev->object_map || rbd_dev->object_map_size)
> + return -EINVAL;
>
> num_objects = ceph_get_num_objects(&rbd_dev->layout,
> rbd_dev->mapping.size);
Hi Aditya,
Could you explain what issue is being fixed? Did you hit this assert?
If so, under what circumstances? The fact that __rbd_object_map_load()
can fail doesn't mean that it shouldn't have asserts...
Thanks,
Ilya
prev parent reply other threads:[~2019-12-16 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-15 16:35 [PATCH] rbd: Avoid calling BUG() when object_map is not empty Aditya Pakki
2019-12-15 22:00 ` Markus Elfring
2019-12-16 10:18 ` Ilya Dryomov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOi1vP_dYP05Wj1fpH-U2WLGhOBp3RmFXPvjYmjorx_MLZW6Zg@mail.gmail.com \
--to=idryomov@gmail.com \
--cc=axboe@kernel.dk \
--cc=ceph-devel@vger.kernel.org \
--cc=dongsheng.yang@easystack.cn \
--cc=kjlu@umn.edu \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=sage@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).