Re: fsync() on read-only RAID triggers BUG
From: Sebastian Riemer <hidden>
Date: 2013-01-25 15:09:15
Attachments
- 0001-md-protect-against-crash-upon-fsync-on-ro-array.txt [text/plain] 1066 bytes · preview
From: Sebastian Riemer <hidden>
Date: 2013-01-25 15:09:15
On 20.01.2013 19:44, Ben Hutchings wrote:
# Call fsync() python -c "import os; os.fsync(os.open('/dev/md0', os.O_RDWR))"--- END ---I assume that the sync request should be filtered out at some point before this assertion is made, since there can be nothing to sync.
I wrote a test case in C. It gets SIGSEGV upon fsync. When making the rdevs below also read-only the MD device can't be stopped anymore as it thinks that there is still active IO. The attached patch should fix it. Please confirm. We have to return a completion without incrementing the active IO count. Error code -EROFS seems to be suited best. But the libc fsync gets -EIO anyway: Input/output error Any objection? Cheers, Sebastian