From owner-freebsd-current@FreeBSD.ORG Mon Apr 25 12:16:28 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 283EC1065673; Mon, 25 Apr 2011 12:16:28 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 64A0C8FC12; Mon, 25 Apr 2011 12:16:27 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p3PCGPIC019162; Mon, 25 Apr 2011 14:16:25 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p3PCGPBG019161; Mon, 25 Apr 2011 14:16:25 +0200 (CEST) (envelope-from marius) Date: Mon, 25 Apr 2011 14:16:25 +0200 From: Marius Strobl To: Alexander Motin Message-ID: <20110425121624.GA19134@alchemy.franken.de> References: <4DB54BA9.5050901@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DB54BA9.5050901@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: "Bjoern A. Zeeb" , FreeBSD-Current , Robert Watson Subject: Re: Old ATA disk names emulation [Was: Switch from legacy ata(4) to CAM-based ATA] 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, 25 Apr 2011 12:16:28 -0000 On Mon, Apr 25, 2011 at 01:23:37PM +0300, Alexander Motin wrote: > Hi. > > I've implemented following patch to keep basic compatibility for the > migrating users. I don't like such hacky things, but at least I tried to > make it less invasive. > > The idea: > - New xpt_path_legacy_ata_id() function in CAM tries to predict bus > unit number and then device unit number for specified path, as if it was > with legacy ATA with ATA_STATIC_ID option. > - on attach, ada driver fetches that number (if not disabled using > tunable kern.cam.ada.legacy_aliases), prints to console something like: > ada0: Previously was known as ad12 > , and sets kernel environment variable like: > kern.devalias.ada0="ad12" > - when geom_dev tastes new geom and creates device node for it, it also > tries to match prefix of the device name with present kern.devalias.* > enviromnent variables, and, if some match found, creates alias with > substituted name (ada0 -> ad12, ada0s1 -> ad12s1, etc.). > > The patch is here: http://people.freebsd.org/~mav/legacy_aliases.patch > > I did few tests and it seems like working -- two sets of device nodes > appeared for each device, I can successfully label and mount any of them. > > What will not work: > - old device names won't be seen inside GEOM, so users who hardcoded > provider names in gmirror/gstripe/... metadata (not the default > behavior) are still in trouble. > - patch mimics ATA_STATIC_ID behavior, if user had custom kernel > without it, he should update device names manually. > - it won't work for users with hot-unplugging ATA controllers (not > devices), but I believe it is really rare case. > - low-level tools, such as smartmontools, won't be able to work with > alias devices, as background ada driver doesn't implements legacy > ioctls. May be I could partially fix this. > > Except those, I think this patch should work for the most of users. > > Any more objections/ideas? Is this an acceptable solution? > Hi, given that only the amd64, i386 and pc98 GENERIC kernel configuration files had ATA_STATIC_ID enabled by default it would be highly desireable that your compatibility shim also only mimics that behavior on these archs or probably better actually check for ATA_STATIC_ID and put that option back into the respective kernel configuration files. Marius