Allow to create pool even if mount point directory is not empty if -f is given.

Obtained from:	WHEEL Systems
This commit is contained in:
Pawel Jakub Dawidek 2012-12-30 13:47:40 +00:00
parent 5b47b1e61c
commit 1bba6bdf13
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244857

View File

@ -906,10 +906,11 @@ zpool_do_create(int argc, char **argv)
/*
* Check the validity of the mountpoint and direct the user to use the
* '-m' mountpoint option if it looks like its in use.
* Ignore the checks if the '-f' option is given.
*/
if (mountpoint == NULL ||
if (!force && (mountpoint == NULL ||
(strcmp(mountpoint, ZFS_MOUNTPOINT_LEGACY) != 0 &&
strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0)) {
strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0))) {
char buf[MAXPATHLEN];
DIR *dirp;