Fix intermittent 'zpool add' failures
authorNed Bass <bass6@llnl.gov>
Fri, 22 Oct 2010 00:08:30 +0000 (17:08 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 22 Oct 2010 19:38:58 +0000 (12:38 -0700)
Creating whole-disk vdevs can intermittently fail if a udev-managed symlink to
the disk partition is already in place.  To avoid this, we now remove any such
symlink before partitioning the disk.  This makes zpool_label_disk_wait() truly
wait for the new link to show up instead of returning if it finds an old link
still in place.  Otherwise there is a window between when udev deletes and
recreates the link during which access attempts will fail with ENOENT.

Also, clean up a comment about waiting for udev to create symlinks.  It no
longer needs to describe the special cases for the link names, since that is
now handled in a separate helper function.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

No differences found