Skip to content

Commit

Permalink
FreeBSD: Fix zfsd auto online
Browse files Browse the repository at this point in the history
The path passed may in fact be a guid, so we want to use the fullpath we
looked up from the pool config instead. But, this causes tests to fail
on Linux so we only do it for FreeBSD.

Signed-off-by: Ryan Moeller <[email protected]>
  • Loading branch information
Ryan Moeller authored and Ryan Moeller committed Feb 25, 2022
1 parent 676ac05 commit 31158fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3072,11 +3072,15 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
}

if (wholedisk) {
#ifdef __FreeBSD__
const char *fullpath = pathname;
#else
const char *fullpath = path;
#endif
char buf[MAXPATHLEN];

if (path[0] != '/') {
error = zfs_resolve_shortname(path, buf,
if (fullpath[0] != '/') {
error = zfs_resolve_shortname(fullpath, buf,
sizeof (buf));
if (error != 0)
return (zfs_error(hdl, EZFS_NODEVICE,
Expand Down

0 comments on commit 31158fd

Please sign in to comment.