-
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
Renaming a zvol which is opened does not move/rename the symlink in /dev/Pool/ and we lose access to zvol device #6729
Comments
@arturpzol thanks for reporting this. It looks like the issue is cause by this bit of code which prevents the minor renaming for in use volumes, but allow the dataset rename to occur. Let's get @bprotopopov thoughts on this. |
Sure I will take a look as soon as I can.
As a potential user of this feature, however, I would be concerned with a possibility that this is not a common and well tested workflow/code path in Linux.
Typos courtesy of my iPhone
On Oct 6, 2017, at 1:01 PM, Brian Behlendorf <[email protected]<mailto:[email protected]>> wrote:
@arturpzol<https://github.com/arturpzol> thanks for reporting this. It looks like the issue is cause by this bit<https://github.com/zfsonlinux/zfs/blob/a0430cc5a913406cf471bcafac31c5118d89843f/module/zfs/zvol.c#L2147> of code which prevents the minor renaming for in use volumes, but allow the dataset rename to occur. Let's get @bprotopopov<https://github.com/bprotopopov> thoughts on this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#6729 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACX4ucZznYmR_bjFXeTkSu6_UYKT_3FGks5splzjgaJpZM4PwTgT>.
|
@bprotopopov, @behlendorf is this condition here still required as in ef1bdf3 I ask regarding to:
mentioned here #4346 and
mentioned here #3830 BTW: without this condition |
@arturpzol It looks to me like now that we're holding the |
Yes,
I’ve reviewed the code and I can’t see any issues with protection of zvol state remaining after the latest locking rework.
One remaining detail is with renaming while suspended that I did not fully look through yet.
Typos courtesy of my iPhone
On Oct 10, 2017, at 3:24 PM, Brian Behlendorf <[email protected]<mailto:[email protected]>> wrote:
@arturpzol<https://github.com/arturpzol> It looks to me like now that we're holding the zv_state_lock in zvol_ioctl() and zvol_rename_minors_impl the name is properly protected and it's safe to drop this check.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#6729 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACX4ucOrDKLBJOSlSnpdy-40JmhJshZQks5sq8R2gaJpZM4PwTgT>.
|
I don't feel that I fully understand what is supposed to happen when someone tries to rename a suspended zvol. A zvol can be suspended with or without being open, as I understand it. If a zvol were to be renamed while suspended, due to asynchronous nature of the
Perhaps @behlendorf , can you comment ? |
@tuxoko maybe you can also comment on the rename/suspend interaction |
@bprotopopov good catch regarding What's curious to me is why we need a I'd be interested in @tuxoko's take on this too. |
My intention is to group volumes, in order to be able to snapshot selected volumes at once. First renamed a volume that was in use by an active VM and noticed the symlinks were not updated. After shutdown of the active VM, I renamed again, but the partition-links were still not updated. Update: Using the ZFS from standard distribution Ubuntu 16.04 LTS. |
@njvdh not sure why you are seeing this; perhaps zvol was still in use when you attempted rename; @behlendorf, looking at the @tuxoko commit 040dab9, it appears that the code segment in This problem appears to be there regardless of whether we skip referenced zvol on rename or not (the topic of this issue). Perhaps one way to move forward is to address the present issue by removing the check for referenced zvols, and to file another issue that describes the potential concerns vis-a-vis rename and suspend/resume interaction. |
@bprotopopov initially I renamed while the zvol was in use and noticed that the links were not updated. |
@bprotopopov So I look at the filesystem side to code. The correct way seems to get the ds from objset before suspend. And then later use that to find the objset. |
thanks for the pointer, @tuxoko, I'll take a look as well |
Looks like it may not just be renaming that triggers it - looking into an issue that looks a bit like this seems to be brought on by creating snapshots or a race condition in 0.7.3. |
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions. |
System information
Describe the problem you're observing
When we rename the zvol which is opened, udev does not change zvol symlink in /dev/Pool/.
Access to zvol device is also not possible after it.
Describe how to reproduce the problem
ZFS 0.6.5.6 and 0.7.2:
then access to the zvol is not possible:
udevadm trigger
andudevadm settle
executed after it does not fix the symlink. Only one solve is export and import Pool again.When zvol is not used/opened during rename we can see udev events from
udevadm monitor
:When zvol is used/opened during rename above udev events are not generated.
It works correctly in 0.6.5.5 and issue was introduced in 0.6.5.6 where some zvol changes have been made.
The text was updated successfully, but these errors were encountered: