Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Apr 2010 20:05:25 +0300
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        bug-followup@FreeBSD.org
Cc:        freebsd-fs@FreeBSD.org, Poul-Henning Kamp <phk@critter.freebsd.dk>
Subject:   Re: conf/116931: lack of fsck_cd9660 prevents mounting iso images with mdconfig_md%d (with workaround)
Message-ID:  <866348jwkq.fsf@kopusha.onet>
In-Reply-To: <201004031051.o33ApQvX068492@freefall.freebsd.org> (brucec@freebsd.org's message of "Sat\, 3 Apr 2010 10\:51\:26 GMT")
References:  <201004031051.o33ApQvX068492@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

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"

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?866348jwkq.fsf>