Description of problem: In snapshot based mirroring after disabling some image feature from primary, then after resync of images in secondary image info still holds the flags of invalid feature in `features` section. e.g Disabled `object-map,fast-diff` image feature from primary [ceph: root@ceph-rbd1-sangadi-udsc8d-node1-installer /]# rbd info rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo rbd image 'rep_image_WEbRXwjgSo': size 1 GiB in 256 objects order 22 (4 MiB objects) snapshot_count: 1 id: 3a3b68a80206 block_name_prefix: rbd_data.3a3b68a80206 format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten op_features: flags: create_timestamp: Fri Mar 10 08:06:24 2023 access_timestamp: Fri Mar 10 08:06:24 2023 modify_timestamp: Fri Mar 10 08:21:29 2023 mirroring state: enabled mirroring mode: snapshot mirroring global id: 3d66e921-1c82-46cb-a9e9-164cbdac5fba mirroring primary: true [ceph: root@ceph-rbd1-sangadi-udsc8d-node1-installer /]# rbd feature disable rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo object-map,fast-diff [ceph: root@ceph-rbd1-sangadi-udsc8d-node1-installer /]# [ceph: root@ceph-rbd1-sangadi-udsc8d-node1-installer /]# rbd info rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo rbd image 'rep_image_WEbRXwjgSo': size 1 GiB in 256 objects order 22 (4 MiB objects) snapshot_count: 1 id: 3a3b68a80206 block_name_prefix: rbd_data.3a3b68a80206 format: 2 features: layering, exclusive-lock, deep-flatten op_features: flags: create_timestamp: Fri Mar 10 08:06:24 2023 access_timestamp: Fri Mar 10 08:06:24 2023 modify_timestamp: Fri Mar 10 08:21:29 2023 mirroring state: enabled mirroring mode: snapshot mirroring global id: 3d66e921-1c82-46cb-a9e9-164cbdac5fba mirroring primary: true after resync from secondary [ceph: root@ceph-rbd2-sangadi-udsc8d-node1-installer /]# rbd info rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo rbd image 'rep_image_WEbRXwjgSo': size 1 GiB in 256 objects order 22 (4 MiB objects) snapshot_count: 1 id: 3a197fb4a96c block_name_prefix: rbd_data.3a197fb4a96c format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, non-primary op_features: flags: create_timestamp: Fri Mar 10 08:19:25 2023 access_timestamp: Fri Mar 10 08:19:25 2023 modify_timestamp: Fri Mar 10 08:19:25 2023 mirroring state: enabled mirroring mode: snapshot mirroring global id: 3d66e921-1c82-46cb-a9e9-164cbdac5fba mirroring primary: false [ceph: root@ceph-rbd2-sangadi-udsc8d-node1-installer /]# rbd mirror image resync rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo Flagged image for resync from primary [ceph: root@ceph-rbd2-sangadi-udsc8d-node1-installer /]# [ceph: root@ceph-rbd2-sangadi-udsc8d-node1-installer /]# rbd info rep_pool_DqufdZqgib/rep_image_WEbRXwjgSo rbd image 'rep_image_WEbRXwjgSo': size 1 GiB in 256 objects order 22 (4 MiB objects) snapshot_count: 1 id: 3a197d310212 block_name_prefix: rbd_data.3a197d310212 format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, non-primary op_features: flags: object map invalid, fast diff invalid create_timestamp: Fri Mar 10 08:32:33 2023 access_timestamp: Fri Mar 10 08:32:33 2023 modify_timestamp: Fri Mar 10 08:32:33 2023 mirroring state: enabled mirroring mode: snapshot mirroring global id: 3d66e921-1c82-46cb-a9e9-164cbdac5fba mirroring primary: false Once `flags` says object map invalid, fast diff invalid then these image features should be removed from `features` section of image info. Version-Release number of selected component (if applicable): ceph version 16.2.10-138.el8cp (a63ae467c8e1f7503ea3855893f1e5ca189a71b9) pacific (stable) How reproducible: Always Steps to Reproduce: 1.Configure two way mirroring with snapshot based 2.disable some image feature from primary 3.after resync from secondary check features got disabled in features section as well other than flags section. Because in journal based mirroring once these features removed from primary it also getting removed from secondary in the image info feature section. Hence requesting to removed invalid features from features section along with flags retained. Actual results: Invalid image features kept as it is in `features` section of image info. Expected results: Remove invalid image feature from `features` section of image info. Additional info: