Fix for mountpoint=legacy

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
This commit is contained in:
ofthesun9 2023-03-15 00:40:55 +01:00 committed by GitHub
parent fe6a7b787f
commit 8b7342d290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -359,11 +359,12 @@ mount_fs()
# isn't the root fs.
return 0
fi
# Last hail-mary: Hope 'rootmnt' is set!
mountpoint=""
# Don't use mount.zfs -o zfsutils for legacy mountpoint
if [ "$mountpoint" = "legacy" ]; then
ZFS_CMD="mount.zfs"
fi
# Last hail-mary: Hope 'rootmnt' is set!
mountpoint=""
else
mountpoint="$mountpoint1"
fi