[Bug 754805] New: nfsserver restart -=> mounts stuff without unmounting first
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c0 Summary: nfsserver restart -=> mounts stuff without unmounting first Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jnelson-suse@jamponi.net QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0 items listed in /etc/exports may be mounted by /etc/init.d/nfsserver however, they are not /unmounted/ and as a consequence, each iteration of rcnfsserver restart mounts *again*: turnip:~ # mount | grep export turnip:~ # rcnfsserver restart redirecting to systemctl turnip:~ # mount | grep export /dev/mapper/raid-isos on /exports/isos type btrfs (rw,noatime,space_cache) /dev/mapper/raid-multimedia on /exports/multimedia type ext4 (rw,noatime,user_xattr,acl,barrier=0,data=ordered) turnip:~ # rcnfsserver restart redirecting to systemctl turnip:~ # mount | grep export /dev/mapper/raid-isos on /exports/isos type btrfs (rw,noatime,space_cache) /dev/mapper/raid-multimedia on /exports/multimedia type ext4 (rw,noatime,user_xattr,acl,barrier=0,data=ordered) /dev/mapper/raid-isos on /exports/isos type btrfs (rw,noatime,space_cache) /dev/mapper/raid-multimedia on /exports/multimedia type ext4 (rw,noatime,user_xattr,acl,barrier=0,data=ordered) turnip:~ # and so on. bits from /etc/exports (some parts elided): /exports <NETWORK HERE>(fsid=0,insecure,no_subtree_check,rw,crossmnt,wdelay) /exports/multimedia <NETWORK HERE>(root_squash,async,no_subtree_check,crossmnt,bind=/multimedia,rw) /exports/isos <NETWORK HERE>(root_squash,async,no_subtree_check,crossmnt,bind=/isos,rw) Reproducible: Always Steps to Reproduce: 1. 2. 3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c kk zhang <kkzhang@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkzhang@novell.com AssignedTo|bnc-team-screening@forge.pr |dmueller@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|dmueller@suse.com |nfbrown@suse.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c1 Neil Brown <nfbrown@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jnelson-suse@jamponi.net --- Comment #1 from Neil Brown <nfbrown@suse.com> 2012-04-10 01:26:12 UTC --- Hi Jon, this doesn't make a lot of sense. 'nfsserver' doesn't mount anything (except /proc/fs/nfsd). In things are getting mounted then something else must be triggering it. Is '/exports' managed by an automounter? 'nfsserver' would certainly try to access the things listed in /etc/exports which might cause them to be auto-mounted. If accessing that causes them to be mounted again, then it is a problem with the automounter. Are the mount points listed repeatedly in /proc/mounts or only in /etc/mtab (or is /etc/mtab a link to /proc/mounts?). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c2 Jon Nelson <jnelson-suse@jamponi.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jnelson-suse@jamponi.net | --- Comment #2 from Jon Nelson <jnelson-suse@jamponi.net> 2012-04-10 02:04:58 UTC --- The file /etc/init.d/nfsserver contains functions (nfs4_bind_mounts) and nfs4_unbind_mounts. The former: nfs4_bind_mounts() { # In case of doubt, try "man sed" :-) cat /etc/exports | sed -n 'H;g;s/\\$//;h;t;s/^\n//;s/\n[[:space:]]*//g;s/#.*//;p;s/.*//;h' | sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' | sort | while read export dir; do test -d "$export" || mkdir -p "$export" # Fortunately, mount ignores unknown # options, so we have an easy way to # tag our "magic" bind mounts mount -o bind,nfsexp "$dir" "$export" done } However, the latter is coded wrong and doesn't work (I'm not sure it ever worked). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c3 Neil Brown <nfbrown@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #3 from Neil Brown <nfbrown@suse.com> 2012-04-17 00:54:58 UTC --- Oh yes, of course. I keep forgetting about that. I think it did work when /etc/mtab was a normal file. Now that it is a symlink to /proc/mounts, it needs fixing. However I don't think we actually need the bind-mounts any more. nfs-utils and the kernel do something clever so it all 'just works'. I'll try to find time to sort out the right solution, but I've been very busy of late, so it might be a while. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c4 Neil Brown <nfbrown@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |jnelson-suse@jamponi.net --- Comment #4 from Neil Brown <nfbrown@suse.com> 2012-04-30 03:17:20 UTC --- I suspect a patch like the following would fix it. Can you test? However it would be best not to use the bind= exports and more, they aren't needed. If remove the "bind=" options from /etc/exports, and remove the "fsid=0" setting on the exported 'root', then nfsd will automatically export all exported filesystems in a way that NFSv4 can see them. It is 'pseudo-export' the root filesystem so that just the directories needed to get to the export points are visible, and they are read-only. Can you check that works for you too please? Index: nfsserver.init =================================================================== --- nfsserver.init (revision 1) +++ nfsserver.init (working copy) @@ -57,6 +57,7 @@ IDMAPD_CLIENT_STATE=/var/run/nfs/nfs-rpc.idmapd IDMAPD_SERVER_STATE=/var/run/nfs/nfsserver-rpc.idmapd +NFSD_BIND_MOUNTS=/var/run/nfsd.bind.mounts NEED_SVCGSSD=no NEED_IDMPAPD=no @@ -101,17 +102,13 @@ sort | while read export dir; do test -d "$export" || mkdir -p "$export" - # Fortunately, mount ignores unknown - # options, so we have an easy way to - # tag our "magic" bind mounts - mount -o bind,nfsexp "$dir" "$export" - done + mount -o bind "$dir" "$export" + echo "$dir" "$export" + done > $NFSD_BIND_MOUNTS } nfs4_unbind_mounts() { - - cat /etc/mtab | - grep '\<nfsexp\>' | + cat $NFSD_BIND_MOUNTS | sort -r -k2 | while read src mountpoint crap; do umount -l "$mountpoint" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c5 Jon Nelson <jnelson-suse@jamponi.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|jnelson-suse@jamponi.net | --- Comment #5 from Jon Nelson <jnelson-suse@jamponi.net> 2012-04-30 14:38:17 UTC --- I tested the path. It works. I also removed the 'fsid' root filesystem from /etc/exports, and removed the bind= option from the other entries there. I also had to change the exports themselves from "/exports/whatever" (which was bind mounted to /whatever) to just "/whatever". Then I placed equivalent bind entries in /etc/fstab, mounted them, and then restarted nfsserver. The nfsserver _did_ properly export them. Thanks! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=754805 https://bugzilla.novell.com/show_bug.cgi?id=754805#c6 Neil Brown <nfbrown@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Component|Basesystem |Basesystem Version|Final |Factory Resolution| |FIXED AssignedTo|nfbrown@suse.com |bnc-team-screening@forge.pr | |ovo.novell.com Product|openSUSE 12.1 |openSUSE 12.2 Target Milestone|--- |Milestone 4 --- Comment #6 from Neil Brown <nfbrown@suse.com> 2012-05-02 01:46:29 UTC --- Thanks for the confirmation. I don't think I'll bother with an update for 12.1, but I have applied this patch to our main branch so it will appear in 12.2. I've also request that yast2-nfs-server stop offering fsid=0 as it is no longer needed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com