Created attachment 712230 [details] Bash script to reproduce Description of problem: When adding a write-intent bitmap to an array with a component device which has a low data offset (16 sectors), the bitmap gets written to the data portion of the array. This will be the case with an array that was created as raid0 and converted to raid5. It appears this causes data corruption in the first portion of the array (up to data_disks * chunk_size) Version-Release number of selected component (if applicable): 3.2.6-7.fc17 Steps to Reproduce: 1. Create raid0 array 2. Convert array to raid5 (add disk) 3. Put some data on the array 4. Try to add write-intent bitmap 5. Verify data Actual results: The data is changed when adding write-intent bitmap Expected results: The data is not changed when adding write-intent bitmap Additional info: $ mdadm --grow --bitmap=internal --bitmap-chunk=512M /dev/md/bulk mdadm: failed to set internal bitmap. $ dmesg | tail kernel: [ 543.768771] created bitmap (2 pages) for device md124 kernel: [ 543.768778] md124: bitmap file is out of date, doing full recovery kernel: [ 543.778904] md124: bitmap initialisation failed: -5 $ dd if=/dev/md/bulk bs=16 count=16 | hexdump -C 00000000 62 69 74 6d 04 00 00 00 4d 11 94 a9 39 85 3d 14 |bitm....M...9.=.|
Lars, Did you report this to the upstream mailing list, or is this the first reporting of this incident? Thanks, Jes
This is the first time, I didn't know where else to report it.
I have been trying this out here, but with a slightly different system, also mdadm-3.2.6-7, but with kernel 3.7.0-rc1+. What kernel did you run your tests with? ..... mdadm: added /dev/loop1 Writing random data This looks ok to me: Array device contains: 00000000 88 80 7f 70 88 02 2e ee 0d 40 ff ba 23 82 38 e1 |...p.....@..#.8.| 00000010 42 94 22 30 80 28 4e 62 ec b8 24 28 b5 70 b8 67 |B."0.(Nb..$(.p.g| 00000020 4b eb 29 60 08 3c 0a 8e 71 7c 6d 6e 16 e9 74 09 |K.)`.<..q|mn..t.| 00000030 Array device contains: 00000000 88 80 7f 70 88 02 2e ee 0d 40 ff ba 23 82 38 e1 |...p.....@..#.8.| 00000010 42 94 22 30 80 28 4e 62 ec b8 24 28 b5 70 b8 67 |B."0.(Nb..$(.p.g| 00000020 4b eb 29 60 08 3c 0a 8e 71 7c 6d 6e 16 e9 74 09 |K.)`.<..q|mn..t.| 00000030 press return to continue with cleanup Cheers, Jes
Hi Jes, It seems you have run it with the workaround (the /dev/loop1 is the tell-tale). You should choose 'n' at the beginning. It's good to see that works ;) I've seen the bug with these versions: kernel.x86_64 3.7.6-102.fc17 mdadm.x86_64 3.2.6-7.fc17 kernel.i686 3.6.10-4.fc18 mdadm.i686 3.2.6-1.fc18 kernel.x86_64 3.8.3-203.fc18 mdadm.x86_64 3.2.6-14.fc18 kernel.x86_64 3.9.0-0.rc3.git0.5.fc20 mdadm.x86_64 3.2.6-15.fc19 The patch I added solves the bug for me. One part prevents overwriting the data, the other part actually reserves space when creating a raid0, but I don't know whether it has side-effects.
Created attachment 713595 [details] patch
This message is a reminder that Fedora 17 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 17. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '17'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 17's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 17 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior to Fedora 17's end of life. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Don't want to drop this one - moving to 19
Fedora 20 has a new version of mdadm, 3.3 With this version, the minimum data_offset defaults to 2 * chunk_size. When using this default data_offset, the bug will not manifest. ( commit http://git.neil.brown.name/?p=mdadm.git;a=commitdiff;h=cb19a251a581fe78dcddd1d95dca4d8cb7664819 ) However, the bug is still there and data will be overwritten when data_offset is too small. This can be caused by using the new (as of mdadm 3.3) argument --data-offset, or by using a raid-array created with an older version of mdadm (<= 3.2.6) Also, with mdadm-3.3, the previous workaround does not work any more for reasons unknown to me.
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
I still want to keep an eye on this one.
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle. Changing version to '25'.
Closing due to EOL.