From owner-freebsd-current@FreeBSD.ORG Mon May 14 23:10:35 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E48E0106564A; Mon, 14 May 2012 23:10:34 +0000 (UTC) (envelope-from jbeich@tormail.org) Received: from server2.allsitecontrol.com (server2.allsitecontrol.com [63.143.36.210]) by mx1.freebsd.org (Postfix) with ESMTP id A69C28FC15; Mon, 14 May 2012 23:10:34 +0000 (UTC) Received: from h-234-182.a189.priv.bahnhof.se ([81.170.234.182]:40555 helo=internal.tormail.org) by server2.allsitecontrol.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.77) (envelope-from ) id 1SU4PO-002kCM-TL; Mon, 14 May 2012 19:10:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tormail.org; s=tm; h=Message-Id:X-TorMail-User:Content-Type:MIME-Version:References:Date:In-Reply-To:Subject:Cc:To:From; bh=cR14TDyKm9SsS5pdltNktvzT2UODw8rRvn3ZhVidMVo=; b=PfEc87ujnWp8whMOHmXqObg5r3ZUsJVlxPq98HoVCwUJ6o6JdwUOYVOoffNC7QK/GikpXrjAznqfWFXCYk2KaQkGc4Ng69ANN4P3hQkwSgBb5y+z08Y93P/ykSU0R12jDaefS/vG7xLdWnfcM4jXFnVWKU8ePWSL+lw9Hiy4K1w=; Received: from jbeich by internal.tormail.org with local (Exim 4.63) (envelope-from ) id 1SU4OR-000Hev-Gq; Mon, 14 May 2012 23:09:33 +0000 From: Jan Beich To: Andriy Gapon In-Reply-To: <4FB13567.3050705@FreeBSD.org> (Andriy Gapon's message of "Mon, 14 May 2012 19:40:07 +0300") Date: Mon, 14 May 2012 13:09:01 -1000 References: <4FAF767C.8030500@cran.org.uk> <4FB0ED96.6010100@FreeBSD.org> <20120514171914.7a1e9d10@fabiankeil.de> <4FB12EBF.2030804@FreeBSD.org> <4FB13567.3050705@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain X-TorMail-User: jbeich Message-Id: <1SU4OR-000Hev-Gq@internal.tormail.org> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server2.allsitecontrol.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tormail.org X-Source: X-Source-Args: X-Source-Dir: X-Mailman-Approved-At: Tue, 15 May 2012 00:55:15 +0000 Cc: Bruce Cran , freebsd-current Subject: Re: Default directory used for 'zpool import' broken (/dev/dsk)? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 23:10:35 -0000 Andriy Gapon writes: > on 14/05/2012 19:11 Andriy Gapon said the following: > >> on 14/05/2012 18:19 Fabian Keil said the following: >>> The following patch seems to work for me: >>> >>> #### >>> commit 7ec69700f2d6944a61f5c7a826e67f46fa160221 >>> Author: Fabian Keil >>> Date: Mon May 12 16:53:56 2012 +0200 >>> >>> Default to searching vdevs in /dev. /dev/dsk doesn't exist on FreeBSD. >>> >>> Fixes import issues if no cachefile exists and -d isn't used: >>> >>> fk@r500 ~ $sudo zpool import wde2 >>> cannot open '/dev/dsk': must be an absolute path >> >> Hah, so this hasn't been fixed actually. >> Thank you for the patch! >> >>> diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >>> index fe76250..5d1e454 100644 >>> --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >>> +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >>> @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, char **argv) >>> >>> if (searchdirs == NULL) { >>> searchdirs = safe_malloc(sizeof (char *)); >>> - searchdirs[0] = "/dev/dsk"; >>> + searchdirs[0] = "/dev"; >>> nsearch = 1; >>> } >>> #### >>> >>> The cachefile part is speculation ... >> >> > > Not sure if the following is also necessary, but it looks like it > makes sense: It looks like bin/155104 which affects zdb -e. > > --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c > +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c > @@ -1145,7 +1145,7 @@ zpool_find_import_impl > char *end, **dir = iarg->path; > size_t pathleft; > nvlist_t *ret = NULL; > - static char *default_dir = "/dev/dsk"; > + static char *default_dir = "/dev"; > pool_list_t pools = { 0 }; > pool_entry_t *pe, *penext; > vdev_entry_t *ve, *venext; > > I am not sure if zpool_find_import_impl is ever called with empty/zero > paths/path in the importargs_t parameter.