Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Apr 2010 17:10:13 GMT
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        freebsd-fs@FreeBSD.org
Subject:   Re: conf/116931: lack of fsck_cd9660 prevents mounting iso images with mdconfig_md%d (with workaround)
Message-ID:  <201004031710.o33HADg6087695@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/116931; it has been noted by GNATS.

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)
Date: Sat, 03 Apr 2010 20:05:25 +0300

 --=-=-=
 
 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?201004031710.o33HADg6087695>