-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.6.5.9 regression (compared to 0.6.5.8 and previous) : loop mounted luks encrypted files on zfs are read-only #5776
Comments
Here is my reproducible test case: |
Yeah, We've been hit pretty hard with this regresion. Any workaround whatsoever? |
It would be helpful if someone with this configuration already set up could |
I think we can take LUKS out of the loop (no pun intended), this is reproducible with any "loop" device:
A quick I used SystemTap to print
The code for 868 if (!(file->f_mode & FMODE_WRITE) || !(mode & FMODE_WRITE) ||
869 !file->f_op->write)
870 lo_flags |= LO_FLAGS_READ_ONLY; |
@loli10K thanks for bisecting this. It appears this check wasn't updated to check .write_iter until the 4.0 kernel, torvalds/linux@283e7e5. |
Should be fixed in #5855, please give it a try. |
Commit 933ec99 removes read and write from f_op because the vfs layer will select iter_write or aio_write automatically. However, for Linux <= 4.0, loop_set_fd will actually check f_op->write and set read-only if not exists. This patch add them back and use the generic do_sync_{read,write} for aio_{read,write} and new_sync_{read,write} for {read,write}_iter. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Closes openzfs#5776 Closes openzfs#5855
Commit 933ec99 removes read and write from f_op because the vfs layer will select iter_write or aio_write automatically. However, for Linux <= 4.0, loop_set_fd will actually check f_op->write and set read-only if not exists. This patch add them back and use the generic do_sync_{read,write} for aio_{read,write} and new_sync_{read,write} for {read,write}_iter. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Closes openzfs#5776 Closes openzfs#5855
Commit 933ec99 removes read and write from f_op because the vfs layer will select iter_write or aio_write automatically. However, for Linux <= 4.0, loop_set_fd will actually check f_op->write and set read-only if not exists. This patch add them back and use the generic do_sync_{read,write} for aio_{read,write} and new_sync_{read,write} for {read,write}_iter. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Closes #5776 Closes #5855
System information
Describe the problem you're observing
I have luks encrypted files in my zfs filesystems.
Since 0.6.5.9, when I loop mount them, the filesystem are read-only.
Describe how to reproduce the problem
boot a centos7 machine, install0.6.5.9 zfs (kmod-zfs) and create a file based luks file (xfs formatted), put some files inside.
Create a zpool, put the newly created luks file inside and mount it. It will be mounted read-only.
Doing the same on a 0.6.5.8 zfs, works fine, the luks file is mounted read-write.
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: