-
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
Allow mounting datasets more than once #7207
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
dnl # | ||
dnl # 2.6.38 API change | ||
dnl # The .get_sb callback has been replaced by a .mount callback | ||
dnl # in the file_system_type structure. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_FST_MOUNT], [ | ||
AC_MSG_CHECKING([whether fst->mount() exists]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
static struct dentry * | ||
mount(struct file_system_type *fs_type, int flags, | ||
const char *osname, void *data) { | ||
struct dentry *d = NULL; | ||
return (d); | ||
} | ||
static struct file_system_type fst __attribute__ ((unused)) = { | ||
.mount = mount, | ||
}; | ||
],[ | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_FST_MOUNT, 1, [fst->mount() exists]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy is of the CDDL is also available via the Internet | ||
# at http://www.illumos.org/license/CDDL. | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright(c) 2018 Datto Inc. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Verify multi mount functionality | ||
# | ||
# STRATEGY: | ||
# 1. Create fs | ||
# 2. Create and hold open file in filesystem | ||
# 3. Lazy unmount | ||
# 4. Verify remounting fs that was lazily unmounted is possible | ||
# 5. Verify multiple mounts of the same dataset are possible | ||
# 6. Verify bind mount doesn't prevent rename | ||
# | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
ismounted $MNTPFS && log_must umount $MNTPFS | ||
ismounted $MNTPFS2 && log_must umount $MNTPFS2 | ||
ismounted $MNTPFS3 && log_must umount $MNTPFS3 | ||
ismounted $MNTPFS4 && log_must umount $MNTPFS4 | ||
ismounted $RENAMEMNT && log_must umount $RENAMEMNT | ||
datasetexists $TESTDS && log_must destroy_dataset "$TESTDS" "-f" | ||
} | ||
log_onexit cleanup | ||
|
||
log_assert "Verify multiple mounts into one namespace are possible" | ||
|
||
# 1. Create fs | ||
TESTDS="$TESTPOOL/multi-mount-test" | ||
log_must zfs create $TESTDS | ||
|
||
# 2. Create and hold open file in filesystem | ||
MNTPFS="$(get_prop mountpoint $TESTDS)" | ||
FILENAME="$MNTPFS/file" | ||
log_must mkfile 128k $FILENAME | ||
log_must exec 9<> $FILENAME # open file | ||
|
||
# 3. Lazy umount | ||
log_must umount -l $MNTPFS | ||
if [ -f $FILENAME ]; then | ||
log_fail "Lazy unmount failed" | ||
fi | ||
|
||
# 4. Verify remounting fs that was lazily unmounted is possible | ||
log_must zfs mount $TESTDS | ||
if [ ! -f $FILENAME ]; then | ||
log_fail "Lazy remount failed" | ||
fi | ||
log_must exec 9>&- # close fd | ||
|
||
# 5. Verify multiple mounts of the same dataset are possible | ||
MNTPFS2="$MNTPFS-second" | ||
FILENAME="$MNTPFS2/file" | ||
log_must mkdir $MNTPFS2 | ||
log_must mount -t zfs -o zfsutil $TESTDS $MNTPFS2 | ||
if [ ! -f $FILENAME ]; then | ||
log_fail "First multi mount failed" | ||
fi | ||
|
||
MNTPFS3="$MNTPFS-third" | ||
FILENAME="$MNTPFS3/file" | ||
log_must mkdir $MNTPFS3 | ||
log_must mount -t zfs -o zfsutil $TESTDS $MNTPFS3 | ||
if [ ! -f $FILENAME ]; then | ||
log_fail "Second multi mount failed" | ||
fi | ||
|
||
# 6. Verify bind mount doesn't prevent rename | ||
RENAMEFS="$TESTDS-newname" | ||
MNTPFS4="$MNTPFS-fourth" | ||
log_must mkdir $MNTPFS4 | ||
log_must mount --bind $MNTPFS $MNTPFS4 | ||
log_must zfs rename $TESTDS $RENAMEFS | ||
RENAMEMNT="$(get_prop mountpoint $RENAMEFS)" | ||
FILENAME="$RENAMEMNT/file" | ||
if [ ! -f $FILENAME ]; then | ||
log_fail "Rename failed" | ||
fi | ||
log_must zfs rename $RENAMEFS $TESTDS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, one last thing. We need a cleanup function to make sure this new filesystem has been unmounted and destroyed when this test case exits. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
log_pass "Multiple mounts are possible" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Looks like the.m4
file defining this is missing.