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

user dropped to shell if if boot dataset has mountpoint=legacy #14599

Closed
ofthesun9 opened this issue Mar 9, 2023 · 4 comments · Fixed by #14604
Closed

user dropped to shell if if boot dataset has mountpoint=legacy #14599

ofthesun9 opened this issue Mar 9, 2023 · 4 comments · Fixed by #14604
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@ofthesun9
Copy link
Contributor

System information

Type Version/Name
Distribution Name bookworm
Distribution Version 12
Kernel Version 6.1.0-5-amd64
Architecture amd64
OpenZFS Version 2.1.9 (debian 2.1.9-2)

Describe the problem you're observing

booting (I am using ZFSBootMenu) a dataset where mountpoint=legacy is not working anymore

The boot cmdline sets root=zfs:rpool/ENCR/MISC/machines/bookworm

As far as I get it, the zfs script provided by zfs-initramfs should be

# Last hail-mary: Hope 'rootmnt' is set!
if [ "$mountpoint" = "legacy" ]; then
          ZFS_CMD="mount.zfs"
mountpoint=""
fi

instead of

# Last hail-mary: Hope 'rootmnt' is set!
mountpoint=""
if [ "$mountpoint" = "legacy" ]; then
           ZFS_CMD="mount.zfs"
fi

This fixed my issue.

Describe how to reproduce the problem

Include any warning/errors/backtraces from the system logs

@ofthesun9 ofthesun9 added the Type: Defect Incorrect behavior (e.g. crash, hang) label Mar 9, 2023
@rincebrain
Copy link
Contributor

rincebrain commented Mar 9, 2023

mountpoint=legacy, or mountpoint=none?

because if you have mountpoint=legacy, that change you made shouldn't change you, and if you don't, then you probably mean mountpoint=none, and you want #14473, I believe.

@ofthesun9
Copy link
Contributor Author

I do have mountpoint=legacy
I am using "debian" pakage 2.1.9-2 which is adding some patches issued after the 2.1.9 release

I think that the commit eb823cb is the cause of my issue.
the line 363 should be after the "if" statement (lines 364 365 366)

@rincebrain
Copy link
Contributor

rincebrain commented Mar 9, 2023

Ah, I see. It took me a few reads to notice the problem here. Oh bother.

I don't know if your change is correct either, actually, since I'm pretty sure resetting that in both cases was intended, it's just the conditional being broken by doing so that's the problem...so I think moving the set below the if-fi entirely would work too.

@freqlabs, it seems like #14473 (and #14455) are incorrect because you clear mountpoint right before checking it. Is there some reason the if can't be above that? (I can write the patch, obviously, I just figured I'd ask if there was something that breaks that was the reason you moved it to after in the first place...)

ryao added a commit to ryao/zfs that referenced this issue Mar 10, 2023
eb823cb fix for mountpoint=none broke
mountpoint=legacy because we did not notice during review that
`mountpoint=""` was set before `if [ "$mountpoint" = "legacy" ];`.

When the mountpoint is not legacy, we clear mountpoint so that
mountpoint=none works instead of clearing it unconditionally, which
breaks mountpoint=legacy.

Closes openzfs#14599
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
@ryao
Copy link
Contributor

ryao commented Mar 10, 2023

@ofthesun9 Embarassingly, this was missed by our eyes (mine included) during review. Please open a PR with your change so that we can get it merged. It looks good to me.

behlendorf pushed a commit that referenced this issue Mar 14, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes #14599
Closes #14604
behlendorf pushed a commit to behlendorf/zfs that referenced this issue Mar 14, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes openzfs#14599
Closes openzfs#14604
behlendorf pushed a commit that referenced this issue Mar 15, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes #14599
Closes #14604
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 17, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes openzfs#14599
Closes openzfs#14604
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 17, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes openzfs#14599
Closes openzfs#14604
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 17, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes openzfs#14599
Closes openzfs#14604
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 17, 2023
We need to clear mountpoint only after checking it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: ofthesun9 <olivier@ofthesun.net>
Closes openzfs#14599
Closes openzfs#14604
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants