Skip to content

Commit

Permalink
Race between zfs-share and zfs-mount services
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Wilson <[email protected]>
Closes openzfs#9083
  • Loading branch information
grwilson authored and tonyhutter committed Sep 16, 2019
1 parent a2073f7 commit b0a3800
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions etc/systemd/system/zfs-share.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b0a3800

Please sign in to comment.