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 <behlendorf1@llnl.gov>
Closes #1819
This commit is contained in:
Tim Chase
2013-11-06 23:55:18 -06:00
committed by Brian Behlendorf
parent b1d13a60d1
commit fd4f76160c
4 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -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 "