From owner-freebsd-fs@FreeBSD.ORG Sat Apr 3 17:05:32 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFA1106566C; Sat, 3 Apr 2010 17:05:32 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD5C8FC0C; Sat, 3 Apr 2010 17:05:30 +0000 (UTC) Received: by ewy24 with SMTP id 24so782608ewy.33 for ; Sat, 03 Apr 2010 10:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=nIFYksMTKLKvMk5wrhZu7hoOz/1hIvzgysafqd+ccs0=; b=k3zFIWgrpvpyi5Z+U0TXFz+gQMRvZ8s6EJ4SK/6NT1svGtoH9iT7o5qCB3gQyDzZOn 00+er4ZO41dXQvTsJLBIXKjXlqlImuxG6ZfMCzSiFk67bwesHQFI11wueaGesJk+RsIA ndyQ3jUWcmobyQiCnyPyJmtgUHnpjp4DQViq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=cqlg4SklVA/XZr2I1V2UYySihQIAg3jDGFa04rGSg22sT00Kr4clf5cezzUbNsTUZ8 ZHT3YervaNahZYpvi5Zud7eePVI+KKfTf5jc39xxF02UD/lJFf1FPsKJxtpJ2YvWCws2 1E+84/7NA6gVCh7Y/+FoWTXp/Gg99CmvdUfeY= Received: by 10.213.37.11 with SMTP id v11mr1946995ebd.60.1270314329493; Sat, 03 Apr 2010 10:05:29 -0700 (PDT) Received: from localhost ([95.69.173.18]) by mx.google.com with ESMTPS id 15sm5479425ewy.12.2010.04.03.10.05.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 03 Apr 2010 10:05:28 -0700 (PDT) To: bug-followup@FreeBSD.org References: <201004031051.o33ApQvX068492@freefall.freebsd.org> Organization: TOA Ukraine From: Mikolaj Golub Date: Sat, 03 Apr 2010 20:05:25 +0300 In-Reply-To: <201004031051.o33ApQvX068492@freefall.freebsd.org> (brucec@freebsd.org's message of "Sat\, 3 Apr 2010 10\:51\:26 GMT") Message-ID: <866348jwkq.fsf@kopusha.onet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: freebsd-fs@FreeBSD.org, Poul-Henning Kamp Subject: Re: conf/116931: lack of fsck_cd9660 prevents mounting iso images with mdconfig_md%d (with workaround) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 17:05:32 -0000 --=-=-= We could keep the list of fs types that should not be fsck'ed (like in the first patch below) or could check the pass number in /etc/fstab (the second patch). -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=mdconfig2.fsck_skip_fs.patch --- etc/rc.d/mdconfig2.orig 2010-04-03 18:39:43.000000000 +0300 +++ etc/rc.d/mdconfig2 2010-04-03 19:38:07.000000000 +0300 @@ -39,6 +39,19 @@ start_precmd='[ -n "${_mdconfig2_list}" ]' required_modules="geom_md:g_md" +fsck_skip_fs="cd9660 udf" + +in_list() +{ + local _x _list _i + _x=$1 + _list=$2 + for _i in ${_list}; do + [ "${_x}" = "${_i}" ] && return 0 + done + return 1 +} + is_readonly() { local _mp _ret @@ -95,10 +108,13 @@ for _i in `df ${_file} 2>/dev/null`; do _fs=${_i}; done fi + _fs_type=`awk -v d="${_dev}" '$1 == d {print $3; exit}' /etc/fstab` + # Debugging help. debug "${_md} config: ${_config}" debug "${_md} type: ${_type}" debug "${_md} dev: ${_dev}" + debug "${_md} fs_type: ${_fs_type}" debug "${_md} file: ${_file}" debug "${_md} fs: ${_fs}" debug "${_md} owner: ${_owner}" @@ -109,7 +125,7 @@ mdconfig2_start() { - local _md _fs _mp _mounted _dev _config _type _file _owner _perms _files _populate _fsck_cmd _i + local _md _fs _mp _mounted _dev _config _type _file _owner _perms _files _populate _fsck_cmd _fs_type _i for _md in ${_mdconfig2_list}; do init_variables ${_md} @@ -136,8 +152,9 @@ echo "Creating ${_md} device failed, moving on." continue fi - # Skip fsck for uzip devices. - if [ "${_file}" != "${_file%.uzip}" ]; then + # Skip fsck for uzip devices and for fs types listed in fsck_skip_fs + if [ "${_file}" != "${_file%.uzip}" ] || + in_list "${_fs_type}" "${fsck_skip_fs}"; then _fsck_cmd=":" elif checkyesno background_fsck; then _fsck_cmd="fsck -F" --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=mdconfig2.check_pass.patch --- etc/rc.d/mdconfig2.orig 2010-04-03 18:39:43.000000000 +0300 +++ etc/rc.d/mdconfig2 2010-04-03 19:59:15.000000000 +0300 @@ -136,8 +136,9 @@ echo "Creating ${_md} device failed, moving on." continue fi - # Skip fsck for uzip devices. - if [ "${_file}" != "${_file%.uzip}" ]; then + # Skip fsck for uzip devices or that have zero pass in fstab + if [ "${_file}" != "${_file%.uzip}" ] || + `awk -v d="${_dev}" '$1 == d {exit $6}' /etc/fstab`; then _fsck_cmd=":" elif checkyesno background_fsck; then _fsck_cmd="fsck -F" --=-=-=--