Skip to content

Commit

Permalink
Revert "Let zfs mount all tolerate in-progress mounts"
Browse files Browse the repository at this point in the history
This reverts commit a9cd8bf which introduced a segfault when running
`zfs mount -a` multiple times when there are mountpoints which are
not empty.  This segfault is now seen frequently by the CI after
the mount code was updated to directly call mount(2).

The original reason this logic was added is described in openzfs#8881.
Since then the systemd `zfs-share.target` has been updated to run
"After" the `zfs-mount.server` which should avoid this issue.

Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9560
Closes openzfs#10364
  • Loading branch information
behlendorf authored May 26, 2020
1 parent ce98ed2 commit d1b84da
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6734,25 +6734,8 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
return (1);
}

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);
}
}
if (zfs_mount(zhp, options, flags) != 0)
return (1);
}
break;
}

Expand Down

0 comments on commit d1b84da

Please sign in to comment.