Hide Forgot
Description of problem: If an Image have deep-flattening enabled, then trying to disable it is allowed. But again enabling it is Failing. "If deep-flattening is not supported to be enabled, then disabling it should also be not allowed" Version-Release number of selected component (if applicable): 10.1.1.1 How reproducible: Always Steps to Reproduce: 1. Create Image with all features rbd image 'CLOOONE2': size 2000 GB in 512000 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.10bf712eb141f2 format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten flags: parent: Tanay-RBD/BIG_Image1@t10 overlap: 2000 GB 2. Disable Deep-Flattening rbd feature disable Tanay-RBD/CLOOONE2 deep-flatten 2016-04-13 18:27:05.545235 7fc728ddfd80 5 librbd::AioImageRequestWQ: 0x7fc732eab870 : ictx=0x7fc732ea9fe0 2016-04-13 18:27:05.558188 7fc7098b3700 5 librbd::AioImageRequestWQ: 0x7fc6e40085a0 : ictx=0x7fc6e40078f0 2016-04-13 18:27:05.564883 7fc7090b2700 5 librbd::AioImageRequestWQ: block_writes: 0x7fc6e40078f0, num=1 2016-04-13 18:27:05.567223 7fc7098b3700 5 librbd::AioImageRequestWQ: unblock_writes: 0x7fc6e40078f0, num=0 2016-04-13 18:27:05.567233 7fc7098b3700 5 librbd::AioImageRequestWQ: block_writes: 0x7fc732ea9fe0, num=1 2016-04-13 18:27:05.579417 7fc7098b3700 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 2016-04-13 18:27:05.579483 7fc7090b2700 5 librbd::AioImageRequestWQ: unblock_writes: 0x7fc732ea9fe0, num=0 2016-04-13 18:27:05.579561 7fc7090b2700 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 3.It gets disabled. rbd -p Tanay-RBD --image CLOOONE2 info 2016-04-13 18:28:01.697108 7fcba8ad0d80 5 librbd::AioImageRequestWQ: 0x7fcbb31d8b40 : ictx=0x7fcbb31d72b0 2016-04-13 18:28:01.703439 7fcb895a4700 5 librbd::AioImageRequestWQ: 0x7fcb64003e00 : ictx=0x7fcb640030a0 2016-04-13 18:28:01.710258 7fcb88da3700 5 librbd::AioImageRequestWQ: block_writes: 0x7fcb640030a0, num=1 2016-04-13 18:28:01.712508 7fcb895a4700 5 librbd::AioImageRequestWQ: unblock_writes: 0x7fcb640030a0, num=0 rbd image 'CLOOONE2': size 2000 GB in 512000 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.10bf712eb141f2 format: 2 features: layering, exclusive-lock, object-map, fast-diff flags: parent: Tanay-RBD/BIG_Image1@t10 overlap: 2000 GB 2016-04-13 18:28:01.713213 7fcba8ad0d80 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 2016-04-13 18:28:01.713328 7fcb88da3700 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 4. Again try to re-enable, its Failing, saying failed to update image features rbd feature enable Tanay-RBD/CLOOONE2 deep-flatten 2016-04-13 18:28:06.464603 7f896558dd80 5 librbd::AioImageRequestWQ: 0x7f896f4f0d50 : ictx=0x7f896f4ef4c0 2016-04-13 18:28:06.475605 7f8946061700 5 librbd::AioImageRequestWQ: 0x7f89200085a0 : ictx=0x7f89200078f0 2016-04-13 18:28:06.482352 7f8945860700 5 librbd::AioImageRequestWQ: block_writes: 0x7f89200078f0, num=1 2016-04-13 18:28:06.484378 7f8946061700 5 librbd::AioImageRequestWQ: unblock_writes: 0x7f89200078f0, num=0 2016-04-13 18:28:06.484388 7f8946061700 5 librbd::AioImageRequestWQ: block_writes: 0x7f896f4ef4c0, num=1 rbd: failed to update image features: (22) Invalid argument 2016-04-13 18:28:06.484495 7f896558dd80 -1 librbd: cannot update immutable features 2016-04-13 18:28:06.490453 7f8946061700 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 2016-04-13 18:28:06.490517 7f8945860700 5 librbd::AioImageRequestWQ: unblock_writes: 0x7f896f4ef4c0, num=0 2016-04-13 18:28:06.490813 7f8945860700 5 librbd::AioImageRequestWQ: shut_down: in_flight=0 Actual results: Expected results: Additional info:
This is by design. If the deep-flatten feature is disabled, it can be opened and written to by older RBD clients that don't know how to perform a deep copy-on-write. If that were to happen and the feature re-enabled, there will be data loss after a flatten.
Is there any way to reenable the deep-flatten feature after all older RBD clients are updated and support deep-flatten?
It's not just older clients that you have to worry about -- older cloned images would also be affected if they had *ever* been written to by an older client. That is why we only support enabling it at image creation time. The only reason we permit it to be disabled is to support krbd since it doesn't currently support deep-flatten.