Re: [autofs] BUG() in shrink_dcache_for_umount_subtree on nfs4 mount

2011-05-26 Thread Jeff Layton
On Wed, 25 May 2011 16:08:15 -0400
Jeff Layton jlay...@redhat.com wrote:

 On Wed, 27 Apr 2011 16:23:07 -0700
 Mark Moseley moseleym...@gmail.com wrote:
 
  
  I posted this to bugzilla a while back but I figured I'd paste it here too:
  
  -
  
  I've been getting bit by the exact same bug and been bisecting for the past
  couple of weeks. It's slow going as it can sometimes take a day for the 
  BUG()
  to show up (though can also at time take 10 minutes). And I've also seen it
  more than once where something was good after a day and then BUG()'d later 
  on,
  just to make things more complicated. So the upshot is that while I feel
  confident enough about this latest batch of bisecting to post it here, I
  wouldn't bet my life on it. I hope this isn't a case where bisecting just 
  shows
  where the bug gets exposed but not where it actually got planted :)
  
  Incidentally, I tried the patch from the top of this thread and it didn't 
  seem
  to make a difference. I still got bit.
  
  I've posted on the linux-fsdevel thread that Jeff Layton started about it,
  http://www.spinics.net/lists/linux-nfs/msg20280.html if you need more 
  details
  on my setup (though I'll be happy to provide anything else you need). 
  Though in
  that thread you'll see that I'm not using autofs explicitly, the Netapp GX
  cluster NFS appears to use autofs to do the implicit submounts (I'm not 100%
  sure that's the correct terminology, so hopefully you know what I mean).
  
  Here's my bisect log, ending up at commit
  e61da20a50d21725ff27571a6dff9468e4fb7146
  
  git bisect start 'fs'
  # good: [3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5] Linux 2.6.37
  git bisect good 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
  # bad: [c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470] Linux 2.6.38-rc1
  git bisect bad c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470
  # good: [7c955fca3e1d8132982148267d9efcafae849bb6] Merge branch 'for_linus' 
  of
  git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6
  git bisect good 7c955fca3e1d8132982148267d9efcafae849bb6
  # good: [c32b0d4b3f19c2f5d29568f8b7b72b61693f1277] fs/mpage.c: consolidate 
  code
  git bisect good c32b0d4b3f19c2f5d29568f8b7b72b61693f1277
  # bad: [f8206b925fb0eba3a11839419be118b09105d7b1] Merge branch 'for-linus' 
  of
  git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
  git bisect bad f8206b925fb0eba3a11839419be118b09105d7b1
  # good: [a8f2800b4f7b76cecb7209cb6a7d2b14904fc711] nfsd4: fix callback
  restarting
  git bisect good a8f2800b4f7b76cecb7209cb6a7d2b14904fc711
  # bad: [6651149371b842715906311b4631b8489cebf7e8] autofs4: Clean up
  autofs4_free_ino()
  git bisect bad 6651149371b842715906311b4631b8489cebf7e8
  # good: [0ad53eeefcbb2620b6a71ffdaad4add20b450b8b] afs: add afs_wq and use 
  it
  instead of the system workqueue
  git bisect good 0ad53eeefcbb2620b6a71ffdaad4add20b450b8b
  # good: [01c64feac45cea1317263eabc4f7ee1b240f297f] CIFS: Use d_automount()
  rather than abusing follow_link()
  git bisect good 01c64feac45cea1317263eabc4f7ee1b240f297f
  # good: [b5b801779d59165c4ecf1009009109545bd1f642] autofs4: Add d_manage()
  dentry operation
  git bisect good b5b801779d59165c4ecf1009009109545bd1f642
  # bad: [e61da20a50d21725ff27571a6dff9468e4fb7146] autofs4: Clean up inode
  operations
  git bisect bad e61da20a50d21725ff27571a6dff9468e4fb7146
  # good: [8c13a676d5a56495c350f3141824a5ef6c6b4606] autofs4: Remove unused 
  code
  git bisect good 8c13a676d5a56495c350f3141824a5ef6c6b4606
 
 I can more or less reproduce this at will now, I think even with very
 few NFS operations on an automounted nfsv4 mount. Here's an oops from a
 2.6.39 kernel:
 
 [  119.419789] tun0: Features changed: 0x4800 - 0x4000
 [  178.242917] FS-Cache: Netfs 'nfs' registered for caching
 [  178.269980] SELinux: initialized (dev 0:2c, type nfs4), uses genfs_contexts
 [  178.282296] SELinux: initialized (dev 0:2d, type nfs4), uses genfs_contexts
 [  523.953284] BUG: Dentry 8801f3084180{i=2,n=} still in use (1) [unmount 
 of nfs4 0:2c]
 [  523.953306] [ cut here ]
 [  523.954013] kernel BUG at fs/dcache.c:925!
 [  523.954013] invalid opcode:  [#1] SMP 
 [  523.954013] last sysfs file: /sys/devices/virtual/bdi/0:45/uevent
 [  523.954013] CPU 1 
 [  523.954013] Modules linked in: nfs lockd auth_rpcgss nfs_acl tun fuse 
 ip6table_filter ip6_tables ebtable_nat ebtables sunrpc cachefiles fscache 
 cpufreq_ondemand powernow_k8 freq_table mperf it87 adt7475 hwmon_vid xfs 
 snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel raid1 snd_hda_codec 
 snd_usb_audio snd_usbmidi_lib snd_hwdep snd_seq snd_rawmidi snd_seq_device 
 snd_pcm snd_timer snd uvcvideo ppdev videodev soundcore media sp5100_tco 
 v4l2_compat_ioctl32 edac_core parport_pc snd_page_alloc i2c_piix4 
 edac_mce_amd k10temp parport wmi r8169 microcode mii virtio_net kvm_amd kvm 
 ipv6 ata_generic 

Re: [autofs] BUG() in shrink_dcache_for_umount_subtree on nfs4 mount

2011-05-26 Thread Ian Kent
On Thu, 2011-05-26 at 09:49 -0400, Jeff Layton wrote:
 On Wed, 25 May 2011 16:08:15 -0400
 Jeff Layton jlay...@redhat.com wrote:
 
  On Wed, 27 Apr 2011 16:23:07 -0700
  Mark Moseley moseleym...@gmail.com wrote:
  
   
   I posted this to bugzilla a while back but I figured I'd paste it here 
   too:
   
   -
   
   I've been getting bit by the exact same bug and been bisecting for the 
   past
   couple of weeks. It's slow going as it can sometimes take a day for the 
   BUG()
   to show up (though can also at time take 10 minutes). And I've also seen 
   it
   more than once where something was good after a day and then BUG()'d 
   later on,
   just to make things more complicated. So the upshot is that while I feel
   confident enough about this latest batch of bisecting to post it here, I
   wouldn't bet my life on it. I hope this isn't a case where bisecting just 
   shows
   where the bug gets exposed but not where it actually got planted :)
   
   Incidentally, I tried the patch from the top of this thread and it didn't 
   seem
   to make a difference. I still got bit.
   
   I've posted on the linux-fsdevel thread that Jeff Layton started about it,
   http://www.spinics.net/lists/linux-nfs/msg20280.html if you need more 
   details
   on my setup (though I'll be happy to provide anything else you need). 
   Though in
   that thread you'll see that I'm not using autofs explicitly, the Netapp GX
   cluster NFS appears to use autofs to do the implicit submounts (I'm not 
   100%
   sure that's the correct terminology, so hopefully you know what I mean).
   
   Here's my bisect log, ending up at commit
   e61da20a50d21725ff27571a6dff9468e4fb7146
   
   git bisect start 'fs'
   # good: [3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5] Linux 2.6.37
   git bisect good 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
   # bad: [c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470] Linux 2.6.38-rc1
   git bisect bad c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470
   # good: [7c955fca3e1d8132982148267d9efcafae849bb6] Merge branch 
   'for_linus' of
   git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6
   git bisect good 7c955fca3e1d8132982148267d9efcafae849bb6
   # good: [c32b0d4b3f19c2f5d29568f8b7b72b61693f1277] fs/mpage.c: 
   consolidate code
   git bisect good c32b0d4b3f19c2f5d29568f8b7b72b61693f1277
   # bad: [f8206b925fb0eba3a11839419be118b09105d7b1] Merge branch 
   'for-linus' of
   git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
   git bisect bad f8206b925fb0eba3a11839419be118b09105d7b1
   # good: [a8f2800b4f7b76cecb7209cb6a7d2b14904fc711] nfsd4: fix callback
   restarting
   git bisect good a8f2800b4f7b76cecb7209cb6a7d2b14904fc711
   # bad: [6651149371b842715906311b4631b8489cebf7e8] autofs4: Clean up
   autofs4_free_ino()
   git bisect bad 6651149371b842715906311b4631b8489cebf7e8
   # good: [0ad53eeefcbb2620b6a71ffdaad4add20b450b8b] afs: add afs_wq and 
   use it
   instead of the system workqueue
   git bisect good 0ad53eeefcbb2620b6a71ffdaad4add20b450b8b
   # good: [01c64feac45cea1317263eabc4f7ee1b240f297f] CIFS: Use d_automount()
   rather than abusing follow_link()
   git bisect good 01c64feac45cea1317263eabc4f7ee1b240f297f
   # good: [b5b801779d59165c4ecf1009009109545bd1f642] autofs4: Add d_manage()
   dentry operation
   git bisect good b5b801779d59165c4ecf1009009109545bd1f642
   # bad: [e61da20a50d21725ff27571a6dff9468e4fb7146] autofs4: Clean up inode
   operations
   git bisect bad e61da20a50d21725ff27571a6dff9468e4fb7146
   # good: [8c13a676d5a56495c350f3141824a5ef6c6b4606] autofs4: Remove unused 
   code
   git bisect good 8c13a676d5a56495c350f3141824a5ef6c6b4606
  
  I can more or less reproduce this at will now, I think even with very
  few NFS operations on an automounted nfsv4 mount. Here's an oops from a
  2.6.39 kernel:
  
  [  119.419789] tun0: Features changed: 0x4800 - 0x4000
  [  178.242917] FS-Cache: Netfs 'nfs' registered for caching
  [  178.269980] SELinux: initialized (dev 0:2c, type nfs4), uses 
  genfs_contexts
  [  178.282296] SELinux: initialized (dev 0:2d, type nfs4), uses 
  genfs_contexts
  [  523.953284] BUG: Dentry 8801f3084180{i=2,n=} still in use (1) 
  [unmount of nfs4 0:2c]
  [  523.953306] [ cut here ]
  [  523.954013] kernel BUG at fs/dcache.c:925!
  [  523.954013] invalid opcode:  [#1] SMP 
  [  523.954013] last sysfs file: /sys/devices/virtual/bdi/0:45/uevent
  [  523.954013] CPU 1 
  [  523.954013] Modules linked in: nfs lockd auth_rpcgss nfs_acl tun fuse 
  ip6table_filter ip6_tables ebtable_nat ebtables sunrpc cachefiles fscache 
  cpufreq_ondemand powernow_k8 freq_table mperf it87 adt7475 hwmon_vid xfs 
  snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel raid1 snd_hda_codec 
  snd_usb_audio snd_usbmidi_lib snd_hwdep snd_seq snd_rawmidi snd_seq_device 
  snd_pcm snd_timer snd uvcvideo ppdev videodev soundcore media 

[autofs] [PATCH] FedFS file system client support

2011-05-26 Thread Chuck Lever
Hi-

The next release of fedfs-utils will provide all necessary components
for a Linux NFS client to participate in a FedFS domain as a file
system client.  This new utility is intended to be a part of the
upcoming release.

I'm interested in comments on this approach.  Ian had suggested a new
lookup module, but a program map looked simpler to prototype and has
the great advantage of no dependencies between fedfs-utils and autofs.
If program maps have some nasty problem that require the use of a
lookup module, we can take that next step.

---

Chuck Lever (1):
  mount: Add automounter program map for FedFS


 .gitignore |1 
 INSTALL|   10 +-
 README |   14 ++-
 doc/man/Makefile.am|2 
 doc/man/fedfs-map-nfs4.8   |  154 
 doc/man/fedfs.7|4 +
 src/mount/Makefile.am  |5 +
 src/mount/fedfs-map-nfs4.c |  242 
 8 files changed, 422 insertions(+), 10 deletions(-)
 create mode 100644 doc/man/fedfs-map-nfs4.8
 create mode 100644 src/mount/fedfs-map-nfs4.c

-- 
Chuck Lever

___
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs


[autofs] [PATCH] mount: Add automounter program map for FedFS

2011-05-26 Thread Chuck Lever
This new utility interprets the passed-in key as a FedFS domain,
performs a DNS SRV lookup, and generates the mount.nfs parameters
needed to mount the domain.  It can handle multiple read-only and
read-write domain root replicas using support already built into the
automounter.

The FedFS entry in the master map might look like this:

  /nfs4 /usr/sbin/fedfs-map-nfs4

To support other file system protocols, additional lines in the master
map and another program map utility (or options for this one) would be
needed.

Benefits:

  o  Simple to configure

  o  The TLD can be placed anywhere on the client

  o  No additional build or package dependencies on nfs-utils or
 autofs

Signed-off-by: Chuck Lever chuck.le...@oracle.com
---

 .gitignore |1 
 INSTALL|   10 +-
 README |   14 ++-
 doc/man/Makefile.am|2 
 doc/man/fedfs-map-nfs4.8   |  154 
 doc/man/fedfs.7|4 +
 src/mount/Makefile.am  |5 +
 src/mount/fedfs-map-nfs4.c |  242 
 8 files changed, 422 insertions(+), 10 deletions(-)
 create mode 100644 doc/man/fedfs-map-nfs4.8
 create mode 100644 src/mount/fedfs-map-nfs4.c

diff --git a/.gitignore b/.gitignore
index ce06ff1..41daf0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ src/fedfsd/fedfsd
 src/resolve-junction/resolve-junction
 src/nsdbparams/nsdbparams
 src/mount/mount.fedfs
+src/mount/fedfs-map-nfs4
 libadmin.a
 libjunction.a
 libnsdb.a
diff --git a/INSTALL b/INSTALL
index 8cb8e9e..548381b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -143,12 +143,14 @@ FedFS file server
 
 FedFS client
 
-  o Install mount.fedfs
+  o Install /usr/sbin/fedfs-map-nfs4
 
-  o Create a local /nfs4 directory, and subdirectories for the FedFS
-domains you want to mount
+  o Create a local /nfs4 directory
 
-  o Add lines to /etc/fstab to mount the domains
+  o Install and configure autofs
+
+  o Add an entry to the master map (usually /etc/auto.master) for
+the /nfs4 directory and restart autofs
 
 
 FedFS admin client
diff --git a/README b/README
index 0067ac2..78b9647 100644
--- a/README
+++ b/README
@@ -59,7 +59,10 @@ changed over time.
 
 Installable components include:
 
-   o  A mount command to mount the top of a FedFS domain namespace
+   o  An automounter program map to manage the FedFS domain namespace
+  on FedFS-enabled clients
+
+   o  A mount command to mount parts of a FedFS domain namespace
 
o  An ONC RPC service daemon that runs on file servers enabling the
   management by remote FedFS ADMIN clients of FedFS junctions
@@ -81,9 +84,14 @@ Installable components include:
o  HTML Doxygen style documentation with built-in source browser
 
 
+The automounter program map is a subcommand invoked by the automounter
+to locate FedFS domains and construct appropriate mount options for
+mounting domain roots.  It is used in conjunction with the Linux
+autofs facility.
+
 The mount command is a subcommand invoked by mount(8) to handle the
-housekeeping needed to find and mount FedFS domains at the top of the
-client's FedFS namespace (usually /nfs4 for NFSv4 servers).
+housekeeping needed to find and mount part or all of FedFS domain
+name spaces.
 
 The fedfsd program is an RPC server that allows remote administrators to
 create FedFS junctions in local file systems.  FedFS ADMIN requests that
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index 7f92ebf..83c6d03 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -24,6 +24,6 @@
 ##
 
 dist_man7_MANS = fedfs.7
-dist_man8_MANS = rpc.fedfsd.8 mount.fedfs.8
+dist_man8_MANS = rpc.fedfsd.8 mount.fedfs.8 fedfs-map-nfs4.8
 CLEANFILES = cscope.in.out cscope.out cscope.po.out
 DISTCLEANFILES = Makefile.in
diff --git a/doc/man/fedfs-map-nfs4.8 b/doc/man/fedfs-map-nfs4.8
new file mode 100644
index 000..ffc5b6a
--- /dev/null
+++ b/doc/man/fedfs-map-nfs4.8
@@ -0,0 +1,154 @@
+.\@(#)fedfs-map-nfs4.8
+.\
+.\ @file doc/man/fedfs-map-nfs4.8
+.\ @brief man page for fedfs-map-nfs4 command
+.\
+
+.\
+.\ Copyright 2011 Oracle.  All rights reserved.
+.\
+.\ This file is part of fedfs-utils.
+.\
+.\ fedfs-utils is free software; you can redistribute it and/or modify
+.\ it under the terms of the GNU General Public License version 2.0 as
+.\ published by the Free Software Foundation.
+.\
+.\ fedfs-utils is distributed in the hope that it will be useful, but
+.\ WITHOUT ANY WARRANTY; without even the implied warranty of
+.\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\ GNU General Public License version 2.0 for more details.
+.\
+.\ You should have received a copy of the GNU General Public License
+.\ version 2.0 along with fedfs-utils.  If not, see:
+.\
+.\http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+.\
+.TH FEDFS-MAP-NFS4 8 30 Apr 2011
+.SH NAME
+fedfs-map-nfs4 \- generate automounter program 

Re: [autofs] BUG() in shrink_dcache_for_umount_subtree on nfs4 mount

2011-05-26 Thread Jeff Layton
On Thu, 26 May 2011 23:02:32 +0800
Ian Kent ra...@themaw.net wrote:

 On Thu, 2011-05-26 at 09:49 -0400, Jeff Layton wrote:
  On Wed, 25 May 2011 16:08:15 -0400
  Jeff Layton jlay...@redhat.com wrote:
  
   On Wed, 27 Apr 2011 16:23:07 -0700
   Mark Moseley moseleym...@gmail.com wrote:
   

I posted this to bugzilla a while back but I figured I'd paste it here 
too:

-

I've been getting bit by the exact same bug and been bisecting for the 
past
couple of weeks. It's slow going as it can sometimes take a day for the 
BUG()
to show up (though can also at time take 10 minutes). And I've also 
seen it
more than once where something was good after a day and then BUG()'d 
later on,
just to make things more complicated. So the upshot is that while I feel
confident enough about this latest batch of bisecting to post it here, I
wouldn't bet my life on it. I hope this isn't a case where bisecting 
just shows
where the bug gets exposed but not where it actually got planted :)

Incidentally, I tried the patch from the top of this thread and it 
didn't seem
to make a difference. I still got bit.

I've posted on the linux-fsdevel thread that Jeff Layton started about 
it,
http://www.spinics.net/lists/linux-nfs/msg20280.html if you need more 
details
on my setup (though I'll be happy to provide anything else you need). 
Though in
that thread you'll see that I'm not using autofs explicitly, the Netapp 
GX
cluster NFS appears to use autofs to do the implicit submounts (I'm not 
100%
sure that's the correct terminology, so hopefully you know what I mean).

Here's my bisect log, ending up at commit
e61da20a50d21725ff27571a6dff9468e4fb7146

git bisect start 'fs'
# good: [3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5] Linux 2.6.37
git bisect good 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
# bad: [c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470] Linux 2.6.38-rc1
git bisect bad c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470
# good: [7c955fca3e1d8132982148267d9efcafae849bb6] Merge branch 
'for_linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6
git bisect good 7c955fca3e1d8132982148267d9efcafae849bb6
# good: [c32b0d4b3f19c2f5d29568f8b7b72b61693f1277] fs/mpage.c: 
consolidate code
git bisect good c32b0d4b3f19c2f5d29568f8b7b72b61693f1277
# bad: [f8206b925fb0eba3a11839419be118b09105d7b1] Merge branch 
'for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
git bisect bad f8206b925fb0eba3a11839419be118b09105d7b1
# good: [a8f2800b4f7b76cecb7209cb6a7d2b14904fc711] nfsd4: fix callback
restarting
git bisect good a8f2800b4f7b76cecb7209cb6a7d2b14904fc711
# bad: [6651149371b842715906311b4631b8489cebf7e8] autofs4: Clean up
autofs4_free_ino()
git bisect bad 6651149371b842715906311b4631b8489cebf7e8
# good: [0ad53eeefcbb2620b6a71ffdaad4add20b450b8b] afs: add afs_wq and 
use it
instead of the system workqueue
git bisect good 0ad53eeefcbb2620b6a71ffdaad4add20b450b8b
# good: [01c64feac45cea1317263eabc4f7ee1b240f297f] CIFS: Use 
d_automount()
rather than abusing follow_link()
git bisect good 01c64feac45cea1317263eabc4f7ee1b240f297f
# good: [b5b801779d59165c4ecf1009009109545bd1f642] autofs4: Add 
d_manage()
dentry operation
git bisect good b5b801779d59165c4ecf1009009109545bd1f642
# bad: [e61da20a50d21725ff27571a6dff9468e4fb7146] autofs4: Clean up 
inode
operations
git bisect bad e61da20a50d21725ff27571a6dff9468e4fb7146
# good: [8c13a676d5a56495c350f3141824a5ef6c6b4606] autofs4: Remove 
unused code
git bisect good 8c13a676d5a56495c350f3141824a5ef6c6b4606
   
   I can more or less reproduce this at will now, I think even with very
   few NFS operations on an automounted nfsv4 mount. Here's an oops from a
   2.6.39 kernel:
   
   [  119.419789] tun0: Features changed: 0x4800 - 0x4000
   [  178.242917] FS-Cache: Netfs 'nfs' registered for caching
   [  178.269980] SELinux: initialized (dev 0:2c, type nfs4), uses 
   genfs_contexts
   [  178.282296] SELinux: initialized (dev 0:2d, type nfs4), uses 
   genfs_contexts
   [  523.953284] BUG: Dentry 8801f3084180{i=2,n=} still in use (1) 
   [unmount of nfs4 0:2c]
   [  523.953306] [ cut here ]
   [  523.954013] kernel BUG at fs/dcache.c:925!
   [  523.954013] invalid opcode:  [#1] SMP 
   [  523.954013] last sysfs file: /sys/devices/virtual/bdi/0:45/uevent
   [  523.954013] CPU 1 
   [  523.954013] Modules linked in: nfs lockd auth_rpcgss nfs_acl tun fuse 
   ip6table_filter ip6_tables ebtable_nat ebtables sunrpc cachefiles fscache 
   cpufreq_ondemand powernow_k8 freq_table mperf it87 adt7475 hwmon_vid xfs 
   snd_hda_codec_hdmi