aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f11b839166ef..0f260a6e97c4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -70,6 +70,14 @@
70#define RBD_IMAGE_ID_LEN_MAX 64 70#define RBD_IMAGE_ID_LEN_MAX 64
71#define RBD_OBJ_PREFIX_LEN_MAX 64 71#define RBD_OBJ_PREFIX_LEN_MAX 64
72 72
73/* Feature bits */
74
75#define RBD_FEATURE_LAYERING 1
76
77/* Features supported by this (client software) implementation. */
78
79#define RBD_FEATURES_ALL (0)
80
73/* 81/*
74 * An RBD device name will be "rbd#", where the "rbd" comes from 82 * An RBD device name will be "rbd#", where the "rbd" comes from
75 * RBD_DRV_NAME above, and # is a unique integer identifier. 83 * RBD_DRV_NAME above, and # is a unique integer identifier.
@@ -2226,6 +2234,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
2226 __le64 features; 2234 __le64 features;
2227 __le64 incompat; 2235 __le64 incompat;
2228 } features_buf = { 0 }; 2236 } features_buf = { 0 };
2237 u64 incompat;
2229 int ret; 2238 int ret;
2230 2239
2231 ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name, 2240 ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
@@ -2236,6 +2245,11 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
2236 dout("%s: rbd_req_sync_exec returned %d\n", __func__, ret); 2245 dout("%s: rbd_req_sync_exec returned %d\n", __func__, ret);
2237 if (ret < 0) 2246 if (ret < 0)
2238 return ret; 2247 return ret;
2248
2249 incompat = le64_to_cpu(features_buf.incompat);
2250 if (incompat & ~RBD_FEATURES_ALL)
2251 return -ENOTSUPP;
2252
2239 *snap_features = le64_to_cpu(features_buf.features); 2253 *snap_features = le64_to_cpu(features_buf.features);
2240 2254
2241 dout(" snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n", 2255 dout(" snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n",
@@ -2977,7 +2991,7 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
2977 if (ret < 0) 2991 if (ret < 0)
2978 goto out_err; 2992 goto out_err;
2979 2993
2980 /* Get the features for the image */ 2994 /* Get the and check features for the image */
2981 2995
2982 ret = rbd_dev_v2_features(rbd_dev); 2996 ret = rbd_dev_v2_features(rbd_dev);
2983 if (ret < 0) 2997 if (ret < 0)