From owner-freebsd-current@FreeBSD.ORG Mon Apr 25 10:23:44 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 7D72D106566B; Mon, 25 Apr 2011 10:23:44 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A36678FC15; Mon, 25 Apr 2011 10:23:43 +0000 (UTC) Received: by bwz12 with SMTP id 12so2368997bwz.13 for ; Mon, 25 Apr 2011 03:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=k61M9RwHIjl/hrWfNduMORUocK6ijgIa3lOIIDP3Yz8=; b=KvH/nkebI8a4SGZWsNTrvDEJ29SvfgYB7Hd2j4UrEW7TP7dtlMCDchJy2uev5sUXwx CpSRjk7rnM+kGWMZkjSB2gcVl4VZYlIB/e+90f3/GJaoZ/f3VhCUYUNUxpDVDR/dHtKD pm/GKRRMbYPXxHZ9gxjjBufhaPU7vZnzJjPHQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :x-enigmail-version:content-type:content-transfer-encoding; b=rHBEObpNiWk/QlooPhlraaxYRO25JNaSZqzMO9i1G01csUjCiYByEvIJDoFIgeY73v CmqCEhUL+yDmLuEHMc6R092hcYcL9TaRiC+bizZeQVynce7a+NBiKaLBrHKfXgSt2Fsj GBSOjMD56+qdZTof0LFBrBf/NU/k8qIhoEPBk= Received: by 10.204.19.18 with SMTP id y18mr3208605bka.179.1303727022529; Mon, 25 Apr 2011 03:23:42 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id t1sm3189138bkx.7.2011.04.25.03.23.40 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 03:23:41 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB54BA9.5050901@FreeBSD.org> Date: Mon, 25 Apr 2011 13:23:37 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: FreeBSD-Current X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: "Bjoern A. Zeeb" , Robert Watson Subject: 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 10:23:44 -0000 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? -- Alexander Motin