When we are doing features refresh, we need to get the features even if there are some features unsupported enabled after rbd map. Signed-off-by: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> --- drivers/block/rbd.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index f1d9e60..eb59b93 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4446,13 +4446,6 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, if (ret < sizeof (features_buf)) return -ERANGE; - unsup = le64_to_cpu(features_buf.incompat) & ~RBD_FEATURES_SUPPORTED; - if (unsup) { - rbd_warn(rbd_dev, "image uses unsupported features: 0x%llx", - unsup); - return -ENXIO; - } - *snap_features = le64_to_cpu(features_buf.features); dout(" snap_id 0x%016llx features = 0x%016llx incompat = 0x%016llx\n", @@ -4460,13 +4453,25 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, (unsigned long long)*snap_features, (unsigned long long)le64_to_cpu(features_buf.incompat)); + unsup = le64_to_cpu(features_buf.incompat) & ~RBD_FEATURES_SUPPORTED; + if (unsup) { + rbd_warn(rbd_dev, "image uses unsupported features: 0x%llx", + unsup); + return -ENXIO; + } + return 0; } static int rbd_dev_v2_features(struct rbd_device *rbd_dev) { - return _rbd_dev_v2_snap_features(rbd_dev, CEPH_NOSNAP, - &rbd_dev->header.features); + u64 features = 0; + int ret = _rbd_dev_v2_snap_features(rbd_dev, CEPH_NOSNAP, features); + if (ret) + return ret + + rbd_dev->header.features = features + return 0; } static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html