CEPH filesystem development
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 3/4] rbd: implement feature checks
Date: Tue, 09 Oct 2012 16:31:24 -0700	[thread overview]
Message-ID: <5074B3CC.50001@inktank.com> (raw)
In-Reply-To: <5074908C.3010808@inktank.com>

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 10/09/2012 02:01 PM, Alex Elder wrote:
> Version 2 images have two sets of feature bit fields.  The first
> indicates features possibly used by the image.  The second indicates
> features that the client *must* support in order to use the image.
>
> When an image (or snapshot) is first examined, we need to make sure
> that the local implementation supports the image's required
> features.  If not, fail the probe for the image.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   drivers/block/rbd.c |   16 +++++++++++++++-
>   1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 23f3beb..86ab032 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -70,6 +70,14 @@
>   #define RBD_IMAGE_ID_LEN_MAX    64
>   #define RBD_OBJ_PREFIX_LEN_MAX    64
>
> +/* Feature bits */
> +
> +#define RBD_FEATURE_LAYERING      1
> +
> +/* Features supported by this (client software) implementation. */
> +
> +#define RBD_FEATURES_ALL          (0)
> +
>   /*
>    * An RBD device name will be "rbd#", where the "rbd" comes from
>    * RBD_DRV_NAME above, and # is a unique integer identifier.
> @@ -2225,6 +2233,7 @@ static int _rbd_dev_v2_snap_features(struct
> rbd_device *rbd_dev, u64 snap_id,
>           __le64 features;
>           __le64 incompat;
>       } features_buf = { 0 };
> +    u64 incompat;
>       int ret;
>
>       ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
> @@ -2235,6 +2244,11 @@ static int _rbd_dev_v2_snap_features(struct
> rbd_device *rbd_dev, u64 snap_id,
>       dout("%s: rbd_req_sync_exec returned %d\n", __func__, ret);
>       if (ret < 0)
>           return ret;
> +
> +    incompat = le64_to_cpu(features_buf.incompat);
> +    if (incompat & ~RBD_FEATURES_ALL)
> +        return -ENOTSUPP;
> +
>       *snap_features = le64_to_cpu(features_buf.features);
>
>       dout("  snap_id 0x%016llx features = 0x%016llx incompat =
> 0x%016llx\n",
> @@ -2976,7 +2990,7 @@ static int rbd_dev_v2_probe(struct rbd_device
> *rbd_dev)
>       if (ret < 0)
>           goto out_err;
>
> -    /* Get the features for the image */
> +    /* Get the and check features for the image */
>
>       ret = rbd_dev_v2_features(rbd_dev);
>       if (ret < 0)


  reply	other threads:[~2012-10-09 23:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 20:57 [PATCH 0/4] rbd: finish up basic format 2 support Alex Elder
2012-10-09 21:00 ` [PATCH 1/4] rbd: define rbd_update_size() Alex Elder
2012-10-09 23:27   ` Josh Durgin
2012-10-09 23:46     ` Alex Elder
2012-10-10  1:14     ` [PATCH 1/4, v2] rbd: define rbd_update_mapping_size() Alex Elder
2012-10-10  1:17       ` Josh Durgin
2012-10-09 21:00 ` [PATCH 2/4, v2] rbd: define rbd_dev_v2_refresh() Alex Elder
2012-10-09 23:30   ` Josh Durgin
2012-10-09 21:01 ` [PATCH 3/4] rbd: implement feature checks Alex Elder
2012-10-09 23:31   ` Josh Durgin [this message]
2012-10-09 21:01 ` [PATCH 4/4] rbd: activate v2 image support Alex Elder
2012-10-09 23:32   ` Josh Durgin
2012-10-10 15:55 ` [PATCH 0/4] rbd: finish up basic format 2 support Cláudio Martins
2012-10-10 16:29   ` Josh Durgin
2013-08-15 11:42 ` rbd: format 2 support in rbd.ko ? Kasper Dieter
2013-08-15 12:30   ` Damien Churchill

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=5074B3CC.50001@inktank.com \
    --to=josh.durgin@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@inktank.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