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)
commitd877ac6bfefaf09f0399888df1fc88bd4b4419d0
tree0928525665627da713738ac544575409c1a2937d
parentd4055aac3c4fdb6c1b5b1a7b73d20ff716e0a711
Fix intermittent 'zpool add' failures

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>
cmd/zpool/zpool_vdev.c