HomeFreeBSD

Race between zfs-share and zfs-mount services

Description

Race between zfs-share and zfs-mount services

When a system boots the zfs-mount.service and the
zfs-share.service can start simultaneously. What may be
unclear is that sharing a filesystem will first mount
the filesystem if it's not already mounted. This means
that both service can race to mount the same fileystem.
This race can result in a SEGFAULT or EBUSY conditions.

This change explicitly defines the start ordering between the
two services such that the zfs-mount.service is solely
responsible for mounting filesystems eliminating the race
between "zfs mount -a" and "zfs share -a" commands.

Reviewed-by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <george.wilson@delphix.com>
Closes #9083

Details

Provenance
George Wilson <george.wilson@delphix.com>Authored on Jul 29 2019, 1:13 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 29 2019, 1:13 AM
Parents
rG693c1fc478cc: Develop tests for issues #5866 and #8858
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG453bb4791e7d: Race between zfs-share and zfs-mount services (authored by George Wilson <george.wilson@delphix.com>).Jul 29 2019, 1:13 AM