From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 22 19:20:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F591065673 for ; Wed, 22 Oct 2008 19:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 104E88FC22 for ; Wed, 22 Oct 2008 19:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MJK0Rs048694 for ; Wed, 22 Oct 2008 19:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9MJK03q048693; Wed, 22 Oct 2008 19:20:00 GMT (envelope-from gnats) Resent-Date: Wed, 22 Oct 2008 19:20:00 GMT Resent-Message-Id: <200810221920.m9MJK03q048693@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Beran Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F0291065671 for ; Wed, 22 Oct 2008 19:11:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2D58C8FC21 for ; Wed, 22 Oct 2008 19:11:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MJB45b078148 for ; Wed, 22 Oct 2008 19:11:04 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m9MJB4WG078147; Wed, 22 Oct 2008 19:11:04 GMT (envelope-from nobody) Message-Id: <200810221911.m9MJB4WG078147@www.freebsd.org> Date: Wed, 22 Oct 2008 19:11:04 GMT From: Martin Beran To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/128299: [patch] /etc/rc.d/geli does not mount partitions using both journal and eli X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 19:20:01 -0000 >Number: 128299 >Category: conf >Synopsis: [patch] /etc/rc.d/geli does not mount partitions using both journal and eli >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 22 19:20:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Martin Beran >Release: 7.0-RELEASE-p5 >Organization: Trusted Network Solutions, a. s. >Environment: FreeBSD mb.tns.cz 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #4: Tue Oct 21 09:03:29 CEST 2008 root@mb.tns.cz:/usr/obj/usr/src/sys/MB i386 >Description: I have a file system on a device that combines GELI with GJOURNAL. I should be mounted during system startup, but it is not. The corresponding line in /etc/fstab is: /dev/ad0s2d.journal.eli /mntgeli ufs rw,async 1 2 This causes an error in scripts /etc/rc.d/geli and /etc/rc.d/geli2 and the file system is not mounted. The scripts do not handle devices with names containing a dot except the dot in ".eli" suffix. The additional dot is propagated to the value of variable $provider_, which is later used as a part of another variable name. Also, the scripts would not handle a situation with GELI not being the top layer in a stack of GEOM modules, for example, if the GJOURNAL and GELI were swapped (/dev/ad0s2d.eli.journal). >How-To-Repeat: Add an /etc/fstab line for mounting a file system on a device consisting of a GELI over GJOURNAL or GJOURNAL over GELI and reboot. The file system will not be mounted by the system startup scripts. >Fix: The attached patch corrects only the case of GELI over GJOURNAL, not GJOURNAL over GELI. Patch attached with submission follows: diff -cr rc.d/geli /etc/rc.d/geli *** rc.d/geli Wed Oct 22 20:54:46 2008 --- /etc/rc.d/geli Wed Oct 22 08:13:01 2008 *************** *** 54,59 **** --- 54,60 ---- for provider in ${devices}; do provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider_} '.' '_'` eval "flags=\${geli_${provider_}_flags}" if [ -z "${flags}" ]; then diff -cr rc.d/geli2 /etc/rc.d/geli2 *** rc.d/geli2 Wed Oct 22 20:54:46 2008 --- /etc/rc.d/geli2 Wed Oct 22 08:12:34 2008 *************** *** 43,48 **** --- 43,49 ---- for provider in ${devices}; do provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider_} '.' '_'` eval "autodetach=\${geli_${provider_}_autodetach}" if [ -z "${autodetach}" ]; then >Release-Note: >Audit-Trail: >Unformatted: