From fd4f76160cb34539f875781fe7f2dea4b937ace5 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Wed, 6 Nov 2013 23:55:18 -0600 Subject: Handle concurrent snapshot automounts failing due to EBUSY. In the current snapshot automount implementation, it is possible for multiple mounts to attempted concurrently. Only one of the mounts will succeed and the other will fail. The failed mounts will cause an EREMOTE to be propagated back to the application. This commit works around the problem by adding a new exit status, MOUNT_BUSY to the mount.zfs program which is used when the underlying mount(2) call returns EBUSY. The zfs code detects this condition and treats it as if the mount had succeeded. Signed-off-by: Brian Behlendorf Closes #1819 --- cmd/mount_zfs/mount_zfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index 4db33ed69..83b57f4e9 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -528,7 +528,7 @@ main(int argc, char **argv) case EBUSY: (void) fprintf(stderr, gettext("filesystem " "'%s' is already mounted\n"), dataset); - return (MOUNT_SYSERR); + return (MOUNT_BUSY); default: (void) fprintf(stderr, gettext("filesystem " "'%s' can not be mounted due to error " -- cgit v1.2.3