From d237d9a918860b2ec3f442919dbe974532d49251 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Nov 2020 17:14:24 -0800 Subject: Linux: Fix mount/unmount when dataset name has a space The custom zpl_show_devname() helper should translate spaces in to the octal escape sequence \040. The getmntent(2) function is aware of this convention and properly translates the escape character back to a space when reading the fsname. Without this change the `zfs mount` and `zfs unmount` commands incorrectly detect when a dataset with a name containing spaces is mounted. Reviewed-by: Ryan Moeller Signed-off-by: Brian Behlendorf Closes #11182 Closes #11187 --- .../tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh index 0e580a847..d0807ac8d 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_001_pos.ksh @@ -51,6 +51,8 @@ function cleanup log_must zfs destroy -f ${datasets[$i]} ((i = i + 1)) done + + zfs destroy -f "$TESTPOOL/with a space" } log_onexit cleanup @@ -68,4 +70,8 @@ while (( $i < ${#datasets[*]} )); do ((i = i + 1)) done +log_must zfs create "$TESTPOOL/with a space" +log_must zfs unmount "$TESTPOOL/with a space" +log_must zfs mount "$TESTPOOL/with a space" + log_pass "'zfs create ' works as expected." -- cgit v1.2.3