Skip to content
Permalink
Browse files

Let zfs mount all tolerate in-progress mounts

Signed-off-by: Don Brady <don.brady@delphix.com>
  • Loading branch information...
don-brady committed Jun 11, 2019
1 parent 893a6d6 commit 461db880e5f5c5f70be641a56faccc69503bbafc
Showing with 18 additions and 1 deletion.
  1. +18 −1 cmd/zfs/zfs_main.c
@@ -6446,8 +6446,25 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
return (1);
}

if (zfs_mount(zhp, options, flags) != 0)
if (zfs_mount(zhp, options, flags) != 0) {
/*
* Check if a mount sneaked in after we checked
*/
if (!explicit &&
libzfs_errno(g_zfs) == EZFS_MOUNTFAILED) {
usleep(10 * MILLISEC);
libzfs_mnttab_cache(g_zfs, B_FALSE);

if (zfs_is_mounted(zhp, NULL)) {
(void) fprintf(stderr, gettext(
"Ignoring previous 'already "
"mounted' error for '%s'\n"),
zfs_get_name(zhp));
return (0);
}
}
return (1);
}
break;
}

0 comments on commit 461db88

Please sign in to comment.
You can’t perform that action at this time.