Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 341829 - netmount fails to unmount busy NFSv4 filesystems
Summary: netmount fails to unmount busy NFSv4 filesystems
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-19 23:02 UTC by Kevan Carstensen
Modified: 2016-01-13 19:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch that fixes the problem on my system (netmount.diff,923 bytes, patch)
2010-10-20 17:46 UTC, Kevan Carstensen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevan Carstensen 2010-10-19 23:02:26 UTC
In its stop() function, netmount will do its TERM, TERM, KILL routine on processes making network filesystems busy if the first umount -art command is unsuccessful; it checks for failure by checking for any output from that command. This isn't sufficient to check for failure, however. In the case where an NFSv4 filesystem is busy such that it cannot be remounted read-only, umount.nfs4 will produce no output and a nonzero exit status; this propagates back through the umount -art command, but is ignored by the netmount script. The result is that, in certain cases, netmount will conclude that its job is done when it isn't and then later, in halt.sh, the system will hang when trying to unmount those filesystems after a bunch of necessary network services aren't running anymore. If netmount is amended to check both the exit status and the output of the initial unmount command in stop(), it is able to detect and address this edge case, and work as it should.

Also, could rpc.gssd and rpc.idmapd be added to the use decalartion in netmount? NFS can use both of those, and netmount already adds some other things in the declaration for NFS specifically.

Thanks.

Reproducible: Always

Steps to Reproduce:
1. Mount an NFSv4 share.
2. Do something in that share to make it busy, so that unmounting and remounting read-only will fail. For example, run a program that writes a 
3. Do /etc/init.d/netmount stop while whatever you did in step 2 is stll running.

Actual Results:  
netmount does not detect that unmounting has failed, so it does not attempt to kill the processes that are making the mount busy but instead reports that it has finished without issue.

Expected Results:  
netmount detects that unmounting has failed, sends signals to the procesess still using the mount, either successfully unmounts the share or fails to, and reports this to the console.

emerge --info:

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r10 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r10-x86_64-Intel-R-_Xeon-TM-_CPU_3.16GHz-with-gentoo-1.12.13
Timestamp of tree: Thu, 30 Sep 2010 17:45:01 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.5-r2, 3.1.2-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=x86-64 -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=x86-64 -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests buildpkg distlocks fixpackages news nodoc notitles parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://mirror.usu.edu/mirrors/gentoo/ http://prometheus.cs.wmich.edu/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages/stable"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage-local /usr/portage-legacy"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran iconv kerberos logrotate mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session sse sse2 ssl sysfs unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Kevan Carstensen 2010-10-20 17:46:43 UTC
Created attachment 251353 [details, diff]
patch that fixes the problem on my system
Comment 2 Paul B. Henson 2011-02-11 00:00:59 UTC
This is a pretty simple change, any chance a dev could take a quick look at it and maybe push it through?

Thanks...
Comment 3 Kevan Carstensen 2011-05-06 18:27:03 UTC
Has anyone had a chance to take a look at this yet? Is there anything I can do to make it easier to work with this issue?

Thanks.