On Thu, Nov 27, 2008 at 6:01 AM, Pavel Filipensky <Pavel.Filipensky at sun.com> wrote: > Hi, > > I need a code review for: > > 6777298 umountall(1M) -z ... limit unmounting action(s) to the current zone > 6502014 NFS mounts in non-global zones are unmounted if NFS is restarted > in the global zone > 6512906 Autofs mounts in non-global zones are unmounted when autofs is > restarted in the global zone > 6777323 smb mounts in non-global zones are unmounted when smb/client is > restarted in the global zone > > NOTE: 6777298 6777323 were created today and they have not been > propagated to bugs.opensolaris.org yet. > > The first CR in the list introduces a new option -z to umountall(1M). > The remaining CRs utilize the new > option int the stop methods for smf services - nfs/client, smb/client > and autofs. > > Since there is a change to a public interface of umountall(1M), I plan > to create a fast-track PSARC case. > Any experience how are PSARC done in OpenSolaris? Especially can anyone > recommend a sponsor? > > Thanks, > Pavel > > =========================================== > Below is the 'Technical Description' from my onepager draft: > > > 4. Technical Description: > > An additional command line option -z is proposed for umountall(1M). > This option, when used, will limit the unmounting action(s) only > to the current zone. > The use of -z option in non-global zones will have no effect since > non-global zones already do not attempt to unmount mounts coming > from different zones. (This was introduced as a part of the fix for > "5037418 umount: permission denied seen upon zone reboot".) > So the -z option will be effective when used in the global zone and > it will prevent umountall(1M) from unmounting mounts coming from > non-global zones. > > Primary consumers of the new -z option will be stop methods > of various smf services. Let's take the nfs service as an example. > Nfs mounts in non-global zones are unmounted if smf service > svc:/network/nfs/client:default is restarted in the global zone. > This is a bug as the nfs services in different zones should be > independent. The bug is logged as > "6502014 NFS mounts in non-global zones are unmounted if NFS is > restarted in the global zone" > This check shows that there are some more smf service that are not > zones independent: > > $ grep umountall /lib/svc/method/* > > /lib/svc/method/nfs-client: /sbin/umountall -F cachefs > /lib/svc/method/nfs-client: /sbin/umountall -F nfs > /lib/svc/method/smb-client: /sbin/umountall -F smbfs > /lib/svc/method/svc-autofs: /sbin/umountall -F autofs > > Effort was done to check that the use of the -z option is > consistent > with other commands. Many commands use -z together with zone ID: > > ipcrm [-z zone] > ipcs [-z zone] > pkill [-z zoneidlist] > pgrep [-z zoneidlist] > ps [-z zonelist] > prstat [-z zoneidlist] > > No command is currently using the plain -z option. However, older > version of ppriv(1) was using [-z]: > > ppriv -z [-v] > -z Lists all privileges available in the current > zone stdout. > > > There are no side effects of using -z option on other suboptions > to umountall(1). Using -z never changes the behaviour of other > suboptions, -z only only limits their scope.
When would it be desirable for umountall to unmount file systems in all zones? It seems to me that umountall will called during system shutdown or just before a similarly crafted mountall. Unless mountall is extended to do perform its work in all zones in the absence of the -z option, I find the current behavior as dangerous in most usage scenarios. During system shutdown, all zones should be down before the autofs and nfs client services stop in the global zones. In the event that some zone is not shut down, this means that it is likely stuck in a shutting down state and any calls to unmount "stuck" nfs mounts in that zone will result in a hung system call and an SMF stop method timeout. It seems to me that there is a real chance[1] that the RPC calls would not even be routable to an NFS server. See, for example, http://bugs.opensolaris.org/view_bug.do?bug_id=6476438. > > > 4.2. Bug/RFE Number(s): > 6502014 NFS mounts in non-global zones are unmounted if NFS > is restarted in the global zone > > 4.5. Interfaces: > > New option -z for umountall(1M). > > 4.6. Doc Impact: > > This will be added to the umountall(1M) manpage: > > SYNOPSIS > umountall [-k] [-s] [-F FSType] [-l | -r] [-z] [-n] > > > umountall [-k] [-s] [-h host] [-z] [-n] > > ... > > -z Limit the action(s) only to the mounts > coming from the current zone. I suggest instead that the -z option not be added and the following man page change occurs: umountall causes all mounted file systems in the current zone except root, /usr, /var, /var/adm, /var/run, /proc, and /dev/fd to be unmounted. If the FSType is specified, mountall and umountall limit their actions to the FSType specified. There is no guarantee that umountall unmounts busy file systems, even if the -k option is specified. -- Mike Gerdts http://mgerdts.blogspot.com/