]> granicus.if.org Git - zfs/commitdiff
Race between zfs-share and zfs-mount services
authorGeorge Wilson <george.wilson@delphix.com>
Mon, 29 Jul 2019 01:13:56 +0000 (21:13 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 29 Jul 2019 01:13:56 +0000 (18:13 -0700)
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

etc/systemd/system/zfs-share.service.in

index 75ff6e9467679f5f32c4949b22bfd2227b44b3a5..5f4ba411b3cd3d733288a45cd514f166f42292a4 100644 (file)
@@ -5,6 +5,7 @@ After=nfs-server.service nfs-kernel-server.service
 After=smb.service
 Before=rpc-statd-notify.service
 Wants=zfs-mount.service
+After=zfs-mount.service
 PartOf=nfs-server.service nfs-kernel-server.service
 PartOf=smb.service