HomeFreeBSD

Fix send/recv 'dataset is busy' errors

Description

Fix send/recv 'dataset is busy' errors

This commit fixes a regression which was accidentally introduced by
the Linux 2.6.39 compatibility chanages. As part of these changes
instead of holding an active reference on the namepsace (which is
no longer posible) a reference is taken on the super block. This
reference ensures the super block remains valid while it is in use.

To handle the unlikely race condition of the filesystem being
unmounted concurrently with the start of a 'zfs send/recv' the
code was updated to only take the super block reference when there
was an existing reference. This indicates that the filesystem is
active and in use.

Unfortunately, in the 'zfs recv' case this is not the case. The
newly created dataset will not have a super block without an
active reference which results in the 'dataset is busy' error.

The most straight forward fix for this is to simply update the
code to always take the reference even when it's zero. This
may expose us to very very unlikely concurrent umount/send/recv
case but the consequences of that are minor.

Closes #319

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jul 15 2011, 11:15 PM
Parents
rG615ab66d18f7: Provide a rc.d script for archlinux
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG61f218b09001: Fix send/recv 'dataset is busy' errors (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jul 15 2011, 11:37 PM