Skip to content
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

initramfs: Fix legacy mountpoint rootfs [2.1.8] #14284

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

ghost
Copy link

@ghost ghost commented Dec 12, 2022

Legacy mountpoint datasets should not pass -o zfsutil to mount.zfs. Fix the logic in mount_fs() to not forget we have a legacy mountpoint when checking for an org.zol:mountpoint userprop.

Reviewed-by: Richard Yao ryao@gentoo.org
Reviewed-by: Brian Behlendorf behlendorf1@llnl.gov
Signed-off-by: Ryan Moeller ryan@iXsystems.com
Closes #14274
(cherry picked from commit 786ff6a)

Motivation and Context

Description

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Legacy mountpoint datasets should not pass `-o zfsutil` to `mount.zfs`.
Fix the logic in `mount_fs()` to not forget we have a legacy mountpoint
when checking for an `org.zol:mountpoint` userprop.

Reviewed-by: Richard Yao <ryao@gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#14274
(cherry picked from commit 786ff6a)
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Dec 12, 2022
@dfr dfr mentioned this pull request Dec 13, 2022
13 tasks
@behlendorf behlendorf merged commit f28c730 into openzfs:zfs-2.1.8-staging Dec 14, 2022
@ghost ghost deleted the bp-initramfs branch December 14, 2022 14:08
@fandauchytil
Copy link

Hi, there is an issue when attempting to mount a dataset with a mountpoint set to none. The regular command mount.zfs will fail, but it is successful if mount.zfs -o zfsutil is used instead.

This means that the initramfs zfs script will fail if the root DS has its mountpoint set to none:

Command: mount.zfs zroot/ROOT/debian-11 /root/
Message: filesystem 'zroot/ROOT/debian-11' cannot be mounted using 'mount'.
Use 'zfs set mountpoint=legacy' or 'zfs mount zroot/ROOT/debian-11'.
See zfs(8) for more information.
Error: 1

Failed to mount zroot/ROOT/debian-11 on /root/.
Manually mount the filesystem and exit.

The problem appears to be that the result of the condition is the same for legacy, none, and -, but they behave differently.

[ "$mountpoint1" = "none" ] ||

ZFS_CMD="mount.zfs"

I have no real problem with it (I'm using legacy and that works just fine), but I think you should be aware of this behavior.

@ghost
Copy link
Author

ghost commented Feb 2, 2023

@fandauchytil could you try this and let me know if it fixes that for you: #14455

@fandauchytil
Copy link

@freqlabs It works perfectly! Boot with the mointpoint=none property set now functions without any issues. Thank you :).

@ghost ghost mentioned this pull request Feb 3, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants