Commit d3767f0f authored by Ilya Dryomov's avatar Ilya Dryomov

rbd: report unsupported features to syslog

... instead of just returning an error.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarJosh Durgin <jdurgin@redhat.com>
parent 811c6688
...@@ -4183,7 +4183,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, ...@@ -4183,7 +4183,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
__le64 features; __le64 features;
__le64 incompat; __le64 incompat;
} __attribute__ ((packed)) features_buf = { 0 }; } __attribute__ ((packed)) features_buf = { 0 };
u64 incompat; u64 unsup;
int ret; int ret;
ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_name, ret = rbd_obj_method_sync(rbd_dev, rbd_dev->header_name,
...@@ -4196,9 +4196,12 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, ...@@ -4196,9 +4196,12 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id,
if (ret < sizeof (features_buf)) if (ret < sizeof (features_buf))
return -ERANGE; return -ERANGE;
incompat = le64_to_cpu(features_buf.incompat); unsup = le64_to_cpu(features_buf.incompat) & ~RBD_FEATURES_SUPPORTED;
if (incompat & ~RBD_FEATURES_SUPPORTED) if (unsup) {
rbd_warn(rbd_dev, "image uses unsupported features: 0x%llx",
unsup);
return -ENXIO; return -ENXIO;
}
*snap_features = le64_to_cpu(features_buf.features); *snap_features = le64_to_cpu(features_buf.features);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment