<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.linux.nfs">
    <title>gmane.linux.nfs</title>
    <link>http://blog.gmane.org/gmane.linux.nfs</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23459"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23458"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23457"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23456"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23455"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23454"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23453"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23452"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23451"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23450"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23449"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23448"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23447"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23446"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23445"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23444"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23443"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23442"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23441"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.nfs/23440"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23459">
    <title>[patch 1/1] lockd: convert reclaimer thread to kthread interface</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23459</link>
    <description>From: Jeff Layton &lt;jlayton-H+wXaHxf7aLQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;

My understanding is that there is a push to turn the kernel_thread
interface into a non-exported symbol and move all kernel threads to use
the kthread API. This patch changes lockd to use kthread_run to spawn
the reclaimer thread.

I've made the assumption here that the extra module references taken
when we spawn this thread are unnecessary and removed them. I've also
added a KERN_ERR printk that pops if the thread can't be spawned to warn
the admin that the locks won't be reclaimed.

In the future, it would be nice to be able to notify userspace that
locks have been lost (probably by implementing SIGLOST), and adding some
good policies about how long we should reattempt to reclaim the locks.

Finally, I removed a comment about memory leaks that I believe is
obsolete and added a new one to clarify the result of sending a SIGKILL
to the reclaimer thread. As best I can tell, doing so doesn't actually
cause a memory leak.

Signed-off-by: Jeff Layton &lt;jlayton-H+wXaHxf7aLQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
Cc: Trond Myklebust &lt;trond.myklebust-41N18TsMXrtuMpJDpNschA&lt; at &gt;public.gmane.org&gt;
Cc: "J. Bruce Fields" &lt;bfields-uC3wQj2KruNg9hUCZPvPmw&lt; at &gt;public.gmane.org&gt;
Signed-off-by: Andrew Morton &lt;akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/clntlock.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff -puN fs/lockd/clntlock.c~lockd-convert-reclaimer-thread-to-kthread-interface fs/lockd/clntlock.c
--- a/fs/lockd/clntlock.c~lockd-convert-reclaimer-thread-to-kthread-interface
+++ a/fs/lockd/clntlock.c
&lt; at &gt;&lt; at &gt; -14,6 +14,7 &lt; at &gt;&lt; at &gt;
 #include &lt;linux/sunrpc/svc.h&gt;
 #include &lt;linux/lockd/lockd.h&gt;
 #include &lt;linux/smp_lock.h&gt;
+#include &lt;linux/kthread.h&gt;
 
 #define NLMDBG_FACILITYNLMDBG_CLIENT
 
&lt; at &gt;&lt; at &gt; -191,11 +192,15 &lt; at &gt;&lt; at &gt; __be32 nlmclnt_grant(const struct sockad
 void
 nlmclnt_recovery(struct nlm_host *host)
 {
+struct task_struct *task;
+
 if (!host-&gt;h_reclaiming++) {
 nlm_get_host(host);
-__module_get(THIS_MODULE);
-if (kernel_thread(reclaimer, host, CLONE_FS | CLONE_FILES) &lt; 0)
-module_put(THIS_MODULE);
+task = kthread_run(reclaimer, host, "%s-reclaim", host-&gt;h_name);
+if (IS_ERR(task))
+printk(KERN_ERR "lockd: unable to spawn reclaimer "
+"thread. Locks for %s won't be reclaimed! "
+"(%ld)\n", host-&gt;h_name, PTR_ERR(task));
 }
 }
 
&lt; at &gt;&lt; at &gt; -207,7 +212,6 &lt; at &gt;&lt; at &gt; reclaimer(void *ptr)
 struct file_lock *fl, *next;
 u32 nsmstate;
 
-daemonize("%s-reclaim", host-&gt;h_name);
 allow_signal(SIGKILL);
 
 down_write(&amp;host-&gt;h_rwsem);
&lt; at &gt;&lt; at &gt; -233,7 +237,12 &lt; at &gt;&lt; at &gt; restart:
 list_for_each_entry_safe(fl, next, &amp;host-&gt;h_reclaim, fl_u.nfs_fl.list) {
 list_del_init(&amp;fl-&gt;fl_u.nfs_fl.list);
 
-/* Why are we leaking memory here? --okir */
+/*
+ * sending this thread a SIGKILL will result in any unreclaimed
+ * locks being removed from the h_granted list. This means that
+ * the kernel will not attempt to reclaim them again if a new
+ * reclaimer thread is spawned for this host.
+ */
 if (signalled())
 continue;
 if (nlmclnt_reclaim(host, fl) != 0)
&lt; at &gt;&lt; at &gt; -261,5 +270,5 &lt; at &gt;&lt; at &gt; restart:
 nlm_release_host(host);
 lockd_down();
 unlock_kernel();
-module_put_and_exit(0);
+return 0;
 }
_
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2008-12-01T22:27:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23458">
    <title>Re: [PATCH 0/3] NFS regression in 2.6.26?, "task blocked for morethan 120 seconds"</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23458</link>
    <description>On Sun, 2008-11-30 at 19:17 -0500, Trond Myklebust wrote: 

Thanks.

The server was actually running 2.6.25.7 but the matching sources have
since been removed the backports.org so I've reproduce with 2.6.26 and
now I'll add the patches.

Ian.

</description>
    <dc:creator>Ian Campbell</dc:creator>
    <dc:date>2008-12-01T22:09:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23457">
    <title>[NFS] D entists Contact List for the USA</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23457</link>
    <description>

Comes with unlimited use license and at a very resonable price:

--&gt; 164,574 |&gt;entists 
--&gt; 158,242 Physical Addresses
--&gt; 163,185 Phone Numbers
--&gt; 77,878 Office Fax Numbers 
--&gt; 45,954 e mails

only during this week you won't pay the regular $593 price, you get it for $296

Write an email to Monroe-YiFMxoQ3Mhodw2Fo+rOw49BPR1lH4CV8&lt; at &gt;public.gmane.org for additional info 




to get off please email exclude-YiFMxoQ3Mhodw2Fo+rOw49BPR1lH4CV8&lt; at &gt;public.gmane.org



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
_______________________________________________
NFS maillist  -  NFS-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&lt; at &gt;public.gmane.org
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that nfs-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&lt; at &gt;public.gmane.org is being discontinued.
Please subscribe to linux-nfs-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org instead.
    http://vger.kernel.org/vger-lists.html#linux-nfs

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Strong O Karin</dc:creator>
    <dc:date>2008-12-01T22:04:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23456">
    <title>Re: [PATCH 0/4] Support for IPv6 in the showmount command</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23456</link>
    <description>

Chuck Lever wrote:
I believe everything that's needed should be there... let me know if something
is missing... 

steved.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Steve Dickson</dc:creator>
    <dc:date>2008-12-01T19:30:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23455">
    <title>Re: [PATCH] gssd:  unblock DNOTIFY_SIGNAL in case it was blocked.</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23455</link>
    <description>

Neil Brown wrote:
Committed...

steved.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Steve Dickson</dc:creator>
    <dc:date>2008-12-01T19:29:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23454">
    <title>Re: [PATCH nfs-utils] Ensure statd gets started if required when non-root user mounts an NFS filesystem.</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23454</link>
    <description>

Neil Brown wrote:
Committed... 

steved.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Steve Dickson</dc:creator>
    <dc:date>2008-12-01T19:28:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23453">
    <title>[PATCH 5/6] NLM: Clean up nsm_monitor() call</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23453</link>
    <description>Clean up: A few minor clean-ups for nsm_unmonitor():

 o  Arrange dprintk and check of sm_monitored consistently with
    nsm_monitor().

 o  nsm_unmonitor()'s only caller doesn't care about the return code,
    so eliminate it (thanks, Bruce).

 o  The nsm_handle's reference count is bumped in nlm_lookup_host()
    so it should be decremented in nlm_destroy_host() to make it
    easier to see the balance of these two operations.  For the
    moment we leave nsm_release() public.

 o  Use nsm-&gt;sm_name instead of host-&gt;h_name to be consistent with
    other functions in fs/lockd/mon.c.

 o  Collect the public declaration of nsm_unmonitor() in lockd.h with
    other NSM public function declarations.

 o  Add documenting comments.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/host.c                |    7 +++----
 fs/lockd/mon.c                 |   33 +++++++++++++++------------------
 include/linux/lockd/lockd.h    |    1 +
 include/linux/lockd/sm_inter.h |    1 -
 4 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index cd7edc3..8d26d0c 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
&lt; at &gt;&lt; at &gt; -263,10 +263,9 &lt; at &gt;&lt; at &gt; nlm_destroy_host(struct nlm_host *host)
 BUG_ON(!list_empty(&amp;host-&gt;h_lockowners));
 BUG_ON(atomic_read(&amp;host-&gt;h_count));
 
-/*
- * Release NSM handle and unmonitor host.
- */
-nsm_unmonitor(host);
+nsm_unmonitor(host-&gt;h_nsmhandle);
+nsm_release(host-&gt;h_nsmhandle);
+host-&gt;h_nsmhandle = NULL;
 
 clnt = host-&gt;h_rpcclnt;
 if (clnt != NULL)
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 78d5f59..b76d9b2 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
&lt; at &gt;&lt; at &gt; -107,33 +107,30 &lt; at &gt;&lt; at &gt; int nsm_monitor(const struct nlm_host *host)
 return status;
 }
 
-/*
- * Cease to monitor remote host
+/**
+ * nsm_unmonitor - Unregister peer notification
+ * &lt; at &gt;nsm: pointer to nsm_handle of peer to stop monitoring
+ *
+ * If this peer is monitored, this function sends an upcall to
+ * tell the local rpc.statd not to send this peer a notification
+ * when we reboot.
  */
-int
-nsm_unmonitor(struct nlm_host *host)
+void nsm_unmonitor(struct nsm_handle *nsm)
 {
-struct nsm_handle *nsm = host-&gt;h_nsmhandle;
-struct nsm_resres;
-intstatus = 0;
+struct nsm_res res;
 
-if (nsm == NULL)
-return 0;
-host-&gt;h_nsmhandle = NULL;
+dprintk("lockd: nsm_unmonitor(%s)\n", nsm-&gt;sm_name);
 
-if (atomic_read(&amp;nsm-&gt;sm_count) == 1
- &amp;&amp; nsm-&gt;sm_monitored &amp;&amp; !nsm-&gt;sm_sticky) {
-dprintk("lockd: nsm_unmonitor(%s)\n", host-&gt;h_name);
+if (!nsm-&gt;sm_monitored)
+return;
 
-status = nsm_mon_unmon(nsm, SM_UNMON, &amp;res);
-if (status &lt; 0)
+if (atomic_read(&amp;nsm-&gt;sm_count) == 1 &amp;&amp; !nsm-&gt;sm_sticky) {
+if (nsm_mon_unmon(nsm, SM_UNMON, &amp;res) &lt; 0)
 printk(KERN_NOTICE "lockd: cannot unmonitor %s\n",
-host-&gt;h_name);
+nsm-&gt;sm_name);
 else
 nsm-&gt;sm_monitored = 0;
 }
-nsm_release(nsm);
-return status;
 }
 
 /*
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 4ca6f39..e2fa968 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -237,6 +237,7 &lt; at &gt;&lt; at &gt; void  nsm_release(struct nsm_handle *);
  * Host monitoring
  */
 int  nsm_monitor(const struct nlm_host *host);
+void  nsm_unmonitor(struct nsm_handle *nsm);
 
 /*
  * This is used in garbage collection and resource reclaim
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index 546b610..896a5e3 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
&lt; at &gt;&lt; at &gt; -41,7 +41,6 &lt; at &gt;&lt; at &gt; struct nsm_res {
 u32state;
 };
 
-intnsm_unmonitor(struct nlm_host *);
 extern intnsm_local_state;
 
 #endif /* LINUX_LOCKD_SM_INTER_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:58:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23452">
    <title>[PATCH 2/6] NLM: Support IPv6 scope IDs in nlm_display_address()</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23452</link>
    <description>Scope ID support is needed since the kernel's NSM implementation is
about to use these displayed addresses as a mon_name in some cases.

If nsm_use_hostnames is zero, NSM will fail to handle peers that
contact us via a link-local address without scope ID support.  Link-
local addresses do not work without an interface ID, which is stored
in the sockaddr's sin6_scope_id field.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/host.c             |   31 +++++++++++++++++++++++--------
 include/linux/lockd/lockd.h |    2 +-
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 68e00c0..cd7edc3 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
&lt; at &gt;&lt; at &gt; -105,22 +105,37 &lt; at &gt;&lt; at &gt; static void nlm_clear_port(struct sockaddr *sap)
 }
 }
 
-static void nlm_display_address(const struct sockaddr *sap,
-char *buf, const size_t len)
+static void nlm_display_ipv4_address(const struct sockaddr *sap, char *buf,
+     const size_t len)
 {
 const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
+snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin-&gt;sin_addr.s_addr));
+}
+
+static void nlm_display_ipv6_address(const struct sockaddr *sap, char *buf,
+     const size_t len)
+{
 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
 
+if (ipv6_addr_v4mapped(&amp;sin6-&gt;sin6_addr))
+snprintf(buf, len, NIPQUAD_FMT,
+NIPQUAD(sin6-&gt;sin6_addr.s6_addr32[3]));
+else if (sin6-&gt;sin6_scope_id != 0)
+snprintf(buf, len, NIP6_FMT "%%%u", NIP6(sin6-&gt;sin6_addr),
+sin6-&gt;sin6_scope_id);
+else
+snprintf(buf, len, NIP6_FMT, NIP6(sin6-&gt;sin6_addr));
+}
+
+static void nlm_display_address(const struct sockaddr *sap,
+char *buf, const size_t len)
+{
 switch (sap-&gt;sa_family) {
 case AF_INET:
-snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin-&gt;sin_addr.s_addr));
+nlm_display_ipv4_address(sap, buf, len);
 break;
 case AF_INET6:
-if (ipv6_addr_v4mapped(&amp;sin6-&gt;sin6_addr))
-snprintf(buf, len, NIPQUAD_FMT,
- NIPQUAD(sin6-&gt;sin6_addr.s6_addr32[3]));
-else
-snprintf(buf, len, NIP6_FMT, NIP6(sin6-&gt;sin6_addr));
+nlm_display_ipv6_address(sap, buf, len);
 break;
 default:
 snprintf(buf, len, "unsupported address family");
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 4467b83..307a8f0 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -75,7 +75,7 &lt; at &gt;&lt; at &gt; struct nsm_handle {
 size_tsm_addrlen;
 unsigned intsm_monitored : 1,
 sm_sticky : 1;/* don't unmonitor */
-charsm_addrbuf[48];/* address eyecatcher */
+charsm_addrbuf[63];/* presentation address */
 };
 
 /*

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:57:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23451">
    <title>[PATCH 4/6] NLM: Clean up nsm_monitor() call</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23451</link>
    <description>Clean up: A few minor clean-ups for nsm_monitor():

 o  Make sure to return an error if the SM_MON call result is not zero.

 o  Remove the BUG_ON() -- the code will die anyway if nsm is NULL.

 o  Use nsm-&gt;sm_name instead of host-&gt;h_name to be consistent with
    other functions in fs/lockd/mon.c.

 o  Collect the public declaration of nsm_monitor() in lockd.h with
    other NSM public function declarations (eg. nsm_release).

 o  Add documenting comments.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/mon.c                 |   29 ++++++++++++++++++-----------
 include/linux/lockd/lockd.h    |    4 ++++
 include/linux/lockd/sm_inter.h |    1 -
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index a606fbb..78d5f59 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
&lt; at &gt;&lt; at &gt; -69,18 +69,24 &lt; at &gt;&lt; at &gt; nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
 return status;
 }
 
-/*
- * Set up monitoring of a remote host
+/**
+ * nsm_monitor - Notify a peer in case we reboot
+ * &lt; at &gt;host: pointer to nlm_host of peer to notify
+ *
+ * If this peer is not already monitored, this function sends an
+ * upcall to the local rpc.statd to record the name/address of
+ * the peer to notify in case we reboot.
+ *
+ * Returns zero if the peer is monitored by the local rpc.statd;
+ * otherwise a negative errno value is returned.
  */
-int
-nsm_monitor(struct nlm_host *host)
+int nsm_monitor(const struct nlm_host *host)
 {
 struct nsm_handle *nsm = host-&gt;h_nsmhandle;
-struct nsm_resres;
-intstatus;
+struct nsm_res res;
+int status;
 
-dprintk("lockd: nsm_monitor(%s)\n", host-&gt;h_name);
-BUG_ON(nsm == NULL);
+dprintk("lockd: nsm_monitor(%s)\n", nsm-&gt;sm_name);
 
 if (nsm-&gt;sm_monitored)
 return 0;
&lt; at &gt;&lt; at &gt; -92,9 +98,10 &lt; at &gt;&lt; at &gt; nsm_monitor(struct nlm_host *host)
 nsm-&gt;sm_mon_name = nsm_use_hostnames ? nsm-&gt;sm_name : nsm-&gt;sm_addrbuf;
 
 status = nsm_mon_unmon(nsm, SM_MON, &amp;res);
-
-if (status &lt; 0 || res.status != 0)
-printk(KERN_NOTICE "lockd: cannot monitor %s\n", host-&gt;h_name);
+if (res.status != 0)
+status = -EIO;
+if (status &lt; 0)
+printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm-&gt;sm_name);
 else
 nsm-&gt;sm_monitored = 1;
 return status;
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index de9ea7b..4ca6f39 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -233,6 +233,10 &lt; at &gt;&lt; at &gt; extern void  nlm_host_rebooted(const struct sockaddr_in *, const char *,
 unsigned int, u32);
 void  nsm_release(struct nsm_handle *);
 
+/*
+ * Host monitoring
+ */
+int  nsm_monitor(const struct nlm_host *host);
 
 /*
  * This is used in garbage collection and resource reclaim
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index 5a5448b..546b610 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
&lt; at &gt;&lt; at &gt; -41,7 +41,6 &lt; at &gt;&lt; at &gt; struct nsm_res {
 u32state;
 };
 
-intnsm_monitor(struct nlm_host *);
 intnsm_unmonitor(struct nlm_host *);
 extern intnsm_local_state;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:57:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23450">
    <title>[PATCH 6/6] NSM: Serialize SM_MON and SM_UNMON upcalls</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23450</link>
    <description>The Linux NSM implementation currently does nothing to prevent
concurrent SM_MON and SM_UNMON upcalls regarding the same peer.  Races
could cause duplicate SM_MON upcalls for the same peer, or locking
activity during server shutdown might cause SM_MON and SM_UNMON upcalls
to occur in an arbitrary order.

To avoid confusing rpc.statd, add a per-nsm_handle mutex to serialize
the upcalls.  To prevent duplicate upcalls, the mutex is held while the
upcall is outstanding, and is not released until we can tell if the
upcall succeeded.

The nsm_monitor() function is called frequently.  The extra inline
function mitigates the overhead of taking the mutex.  It is only taken
if the nsm_handle is not already monitored.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/host.c             |    1 +
 fs/lockd/mon.c              |   23 ++++++++++++++++-------
 include/linux/lockd/lockd.h |   12 +++++++++++-
 3 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 8d26d0c..bf705d0 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
&lt; at &gt;&lt; at &gt; -697,6 +697,7 &lt; at &gt;&lt; at &gt; retry:
 nsm-&gt;sm_name = (char *) (nsm + 1);
 memcpy(nsm-&gt;sm_name, hostname, hostname_len);
 nsm-&gt;sm_name[hostname_len] = '\0';
+mutex_init(&amp;nsm-&gt;sm_mutex);
 nlm_display_address((struct sockaddr *)&amp;nsm-&gt;sm_addr,
 nsm-&gt;sm_addrbuf, sizeof(nsm-&gt;sm_addrbuf));
 atomic_set(&amp;nsm-&gt;sm_count, 1);
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index b76d9b2..301aeb7 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
&lt; at &gt;&lt; at &gt; -70,8 +70,8 &lt; at &gt;&lt; at &gt; nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
 }
 
 /**
- * nsm_monitor - Notify a peer in case we reboot
- * &lt; at &gt;host: pointer to nlm_host of peer to notify
+ * __nsm_monitor - Notify a peer in case we reboot
+ * &lt; at &gt;nsm: pointer to nsm_handle of peer to notify
  *
  * If this peer is not already monitored, this function sends an
  * upcall to the local rpc.statd to record the name/address of
&lt; at &gt;&lt; at &gt; -80,16 +80,17 &lt; at &gt;&lt; at &gt; nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
  * Returns zero if the peer is monitored by the local rpc.statd;
  * otherwise a negative errno value is returned.
  */
-int nsm_monitor(const struct nlm_host *host)
+int __nsm_monitor(struct nsm_handle *nsm)
 {
-struct nsm_handle *nsm = host-&gt;h_nsmhandle;
 struct nsm_res res;
-int status;
+int status = 0;
 
 dprintk("lockd: nsm_monitor(%s)\n", nsm-&gt;sm_name);
 
+mutex_lock(&amp;nsm-&gt;sm_mutex);
+
 if (nsm-&gt;sm_monitored)
-return 0;
+goto out;
 
 /*
  * Choose whether to record the caller_name or IP address of
&lt; at &gt;&lt; at &gt; -104,6 +105,9 &lt; at &gt;&lt; at &gt; int nsm_monitor(const struct nlm_host *host)
 printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm-&gt;sm_name);
 else
 nsm-&gt;sm_monitored = 1;
+
+out:
+mutex_unlock(&amp;nsm-&gt;sm_mutex);
 return status;
 }
 
&lt; at &gt;&lt; at &gt; -121,8 +125,10 &lt; at &gt;&lt; at &gt; void nsm_unmonitor(struct nsm_handle *nsm)
 
 dprintk("lockd: nsm_unmonitor(%s)\n", nsm-&gt;sm_name);
 
+mutex_lock(&amp;nsm-&gt;sm_mutex);
+
 if (!nsm-&gt;sm_monitored)
-return;
+goto out;
 
 if (atomic_read(&amp;nsm-&gt;sm_count) == 1 &amp;&amp; !nsm-&gt;sm_sticky) {
 if (nsm_mon_unmon(nsm, SM_UNMON, &amp;res) &lt; 0)
&lt; at &gt;&lt; at &gt; -131,6 +137,9 &lt; at &gt;&lt; at &gt; void nsm_unmonitor(struct nsm_handle *nsm)
 else
 nsm-&gt;sm_monitored = 0;
 }
+
+out:
+mutex_unlock(&amp;nsm-&gt;sm_mutex);
 }
 
 /*
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index e2fa968..bf6c1c1 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -76,6 +76,7 &lt; at &gt;&lt; at &gt; struct nsm_handle {
 char *sm_mon_name;
 unsigned intsm_monitored : 1,
 sm_sticky : 1;/* don't unmonitor */
+struct mutexsm_mutex;
 charsm_addrbuf[63];/* presentation address */
 };
 
&lt; at &gt;&lt; at &gt; -236,9 +237,18 &lt; at &gt;&lt; at &gt; void  nsm_release(struct nsm_handle *);
 /*
  * Host monitoring
  */
-int  nsm_monitor(const struct nlm_host *host);
+int  __nsm_monitor(struct nsm_handle *nsm);
 void  nsm_unmonitor(struct nsm_handle *nsm);
 
+static inline int nsm_monitor(const struct nlm_host *host)
+{
+struct nsm_handle *nsm = host-&gt;h_nsmhandle;
+
+if (likely(nsm-&gt;sm_monitored))
+return 0;
+return __nsm_monitor(nsm);
+}
+
 /*
  * This is used in garbage collection and resource reclaim
  * A return value != 0 means destroy the lock/block/share

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:58:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23449">
    <title>[PATCH 3/6] NSM: Support IPv6 version of mon_name</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23449</link>
    <description>The "mon_name" argument of the NSMPROC_MON and NSMPROC_UNMON upcalls
is a string that contains the hostname or IP address of the remote peer
to be notified when this host has rebooted.  The sm-notify command uses
this identifier to contact the peer when we reboot, so it must be
either a well-qualified DNS hostname or a presentation format IP
address string.

When the "nsm_use_hostnames" sysctl is set to zero, the kernel's NSM
provides a presentation format IP address in the "mon_name" argument.
Otherwise, the "caller_name" argument from NLM requests is used,
which is usually just the DNS hostname of the peer.

To support IPv6 addresses for the mon_name argument, we use the
nsm_handle's address eye-catcher, which already contains an appropriate
presentation format address string.  Using the eye-catcher string
obviates the need to use a large buffer on the stack to form the
presentation address string for the upcall.

This patch also addresses a subtle bug.

An NSMPROC_MON request and the subsequent NSMPROC_UNMON request for the
same peer are required to use the same value for the "mon_name"
argument.  Otherwise, rpc.statd's NSMPROC_UNMON processing cannot
locate the database entry for that peer and remove it.

If the setting of nsm_use_hostnames is changed between the time the
kernel sends an NSMPROC_MON request and the time it sends the
NSMPROC_UNMON request for the same peer, the "mon_name" argument for
these two requests may not be the same.  This is because the value of
"mon_name" is currently chosen at the moment the call is made based on
the setting of nsm_use_hostnames

To ensure both requests pass identical contents in the "mon_name"
argument, we now select which string to use for the argument in the
nsm_monitor() function.  A pointer to this string is saved in the
nsm_handle so it can be used for the subsequent NSMPROC_UNMON upcall.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/mon.c              |   45 +++++++++++++++++--------------------------
 include/linux/lockd/lockd.h |    1 +
 2 files changed, 19 insertions(+), 27 deletions(-)

diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 4e7e958..a606fbb 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
&lt; at &gt;&lt; at &gt; -18,8 +18,6 &lt; at &gt;&lt; at &gt;
 
 #define NLMDBG_FACILITYNLMDBG_MONITOR
 
-#define XDR_ADDRBUF_LEN(20)
-
 static struct rpc_clnt *nsm_create(void);
 
 static struct rpc_programnsm_program;
&lt; at &gt;&lt; at &gt; -37,7 +35,13 &lt; at &gt;&lt; at &gt; nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
 {
 struct rpc_clnt*clnt;
 intstatus;
-struct nsm_argsargs;
+struct nsm_args args = {
+.addr= nsm_addr_in(nsm)-&gt;sin_addr.s_addr,
+.prog= NLM_PROGRAM,
+.vers= 3,
+.proc= NLMPROC_NSM_NOTIFY,
+.mon_name= nsm-&gt;sm_mon_name,
+};
 struct rpc_message msg = {
 .rpc_argp= &amp;args,
 .rpc_resp= res,
&lt; at &gt;&lt; at &gt; -46,22 +50,18 &lt; at &gt;&lt; at &gt; nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
 clnt = nsm_create();
 if (IS_ERR(clnt)) {
 status = PTR_ERR(clnt);
+dprintk("lockd: failed to create NSM upcall transport, "
+"status=%d\n", status);
 goto out;
 }
 
-memset(&amp;args, 0, sizeof(args));
-args.mon_name = nsm-&gt;sm_name;
-args.addr = nsm_addr_in(nsm)-&gt;sin_addr.s_addr;
-args.prog = NLM_PROGRAM;
-args.vers = 3;
-args.proc = NLMPROC_NSM_NOTIFY;
 memset(res, 0, sizeof(*res));
 
 msg.rpc_proc = &amp;clnt-&gt;cl_procinfo[proc];
 status = rpc_call_sync(clnt, &amp;msg, 0);
 if (status &lt; 0)
-printk(KERN_DEBUG "nsm_mon_unmon: rpc failed, status=%d\n",
-status);
+dprintk("lockd: NSM upcall RPC failed, status=%d\n",
+status);
 else
 status = 0;
 rpc_shutdown_client(clnt);
&lt; at &gt;&lt; at &gt; -85,6 +85,12 &lt; at &gt;&lt; at &gt; nsm_monitor(struct nlm_host *host)
 if (nsm-&gt;sm_monitored)
 return 0;
 
+/*
+ * Choose whether to record the caller_name or IP address of
+ * this peer in the local rpc.statd's database.
+ */
+nsm-&gt;sm_mon_name = nsm_use_hostnames ? nsm-&gt;sm_name : nsm-&gt;sm_addrbuf;
+
 status = nsm_mon_unmon(nsm, SM_MON, &amp;res);
 
 if (status &lt; 0 || res.status != 0)
&lt; at &gt;&lt; at &gt; -165,25 +171,10 &lt; at &gt;&lt; at &gt; static __be32 *xdr_encode_nsm_string(__be32 *p, char *string)
 
 /*
  * "mon_name" specifies the host to be monitored.
- *
- * Linux uses a text version of the IP address of the remote
- * host as the host identifier (the "mon_name" argument).
- *
- * Linux statd always looks up the canonical hostname first for
- * whatever remote hostname it receives, so this works alright.
  */
 static __be32 *xdr_encode_mon_name(__be32 *p, struct nsm_args *argp)
 {
-charbuffer[XDR_ADDRBUF_LEN + 1];
-char*name = argp-&gt;mon_name;
-
-if (!nsm_use_hostnames) {
-snprintf(buffer, XDR_ADDRBUF_LEN,
- NIPQUAD_FMT, NIPQUAD(argp-&gt;addr));
-name = buffer;
-}
-
-return xdr_encode_nsm_string(p, name);
+return xdr_encode_nsm_string(p, argp-&gt;mon_name);
 }
 
 /*
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 307a8f0..de9ea7b 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -73,6 +73,7 &lt; at &gt;&lt; at &gt; struct nsm_handle {
 char *sm_name;
 struct sockaddr_storagesm_addr;
 size_tsm_addrlen;
+char *sm_mon_name;
 unsigned intsm_monitored : 1,
 sm_sticky : 1;/* don't unmonitor */
 charsm_addrbuf[63];/* presentation address */

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:57:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23448">
    <title>[PATCH 1/6] NLM: Remove address eye-catcher buffers from nlm_host</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23448</link>
    <description>The h_name field in struct nlm_host is a just copy of
h_nsmhandle-&gt;sm_name.  Likewise, the contents of the h_addrbuf field
should be identical to the sm_addrbuf field.

The h_srcaddrbuf field is used only in one place for debugging.  We can
live without this until we get %pI formatting for printk().

Currently these buffers are 48 bytes, but we need to support scope IDs
in IPv6 presentation addresses, which means making the buffers even
larger.  Instead, let's find ways to eliminate them to save space.

Finally, AF_UNSPEC support is no longer needed in nlm_display_address()
now that it is not used for the h_srcaddr field.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 fs/lockd/host.c             |   14 +++-----------
 include/linux/lockd/lockd.h |    3 ---
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index acc2aa5..68e00c0 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
&lt; at &gt;&lt; at &gt; -112,9 +112,6 &lt; at &gt;&lt; at &gt; static void nlm_display_address(const struct sockaddr *sap,
 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
 
 switch (sap-&gt;sa_family) {
-case AF_UNSPEC:
-snprintf(buf, len, "unspecified");
-break;
 case AF_INET:
 snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin-&gt;sin_addr.s_addr));
 break;
&lt; at &gt;&lt; at &gt; -178,7 +175,7 &lt; at &gt;&lt; at &gt; static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
 
 nlm_get_host(host);
 dprintk("lockd: nlm_lookup_host found host %s (%s)\n",
-host-&gt;h_name, host-&gt;h_addrbuf);
+host-&gt;h_name, nsm-&gt;sm_addrbuf);
 goto out;
 }
 
&lt; at &gt;&lt; at &gt; -232,11 +229,6 &lt; at &gt;&lt; at &gt; static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
 
 nrhosts++;
 
-nlm_display_address((struct sockaddr *)&amp;host-&gt;h_addr,
-host-&gt;h_addrbuf, sizeof(host-&gt;h_addrbuf));
-nlm_display_address((struct sockaddr *)&amp;host-&gt;h_srcaddr,
-host-&gt;h_srcaddrbuf, sizeof(host-&gt;h_srcaddrbuf));
-
 dprintk("lockd: nlm_lookup_host created host %s\n",
 host-&gt;h_name);
 
&lt; at &gt;&lt; at &gt; -378,8 +370,8 &lt; at &gt;&lt; at &gt; nlm_bind_host(struct nlm_host *host)
 {
 struct rpc_clnt*clnt;
 
-dprintk("lockd: nlm_bind_host %s (%s), my addr=%s\n",
-host-&gt;h_name, host-&gt;h_addrbuf, host-&gt;h_srcaddrbuf);
+dprintk("lockd: nlm_bind_host %s (%s)\n",
+host-&gt;h_name, host-&gt;h_nsmhandle-&gt;sm_addrbuf);
 
 /* Lock host handle */
 mutex_lock(&amp;host-&gt;h_mutex);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 23da3fa..4467b83 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
&lt; at &gt;&lt; at &gt; -65,9 +65,6 &lt; at &gt;&lt; at &gt; struct nlm_host {
 struct list_headh_granted;/* Locks in GRANTED state */
 struct list_headh_reclaim;/* Locks in RECLAIM state */
 struct nsm_handle *h_nsmhandle;/* NSM status handle */
-
-charh_addrbuf[48],/* address eyecatchers */
-h_srcaddrbuf[48];
 };
 
 struct nsm_handle {

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:57:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23447">
    <title>[PATCH 0/6] First set of patches for 2.6.29</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23447</link>
    <description>These patches add some IPv6 support to the Linux kernel's NSM upcall
implementation, and address a couple of shortcomings in the existing
NLM/NSM implementation.

I'd like you to consider these for 2.6.29.

There are 40 more patches I have queued for 2.6.29 that finish IPv6
support in the NSM upcall implementation, enable IPv6 for lockd, and
finish and enable IPv6 support in NFSD.

---

Chuck Lever (6):
      NSM: Serialize SM_MON and SM_UNMON upcalls
      NLM: Clean up nsm_monitor() call
      NLM: Clean up nsm_monitor() call
      NSM: Support IPv6 version of mon_name
      NLM: Support IPv6 scope IDs in nlm_display_address()
      NLM: Remove address eye-catcher buffers from nlm_host


 fs/lockd/host.c                |   53 ++++++++++--------
 fs/lockd/mon.c                 |  120 +++++++++++++++++++++-------------------
 include/linux/lockd/lockd.h    |   21 ++++++-
 include/linux/lockd/sm_inter.h |    2 -
 4 files changed, 109 insertions(+), 87 deletions(-)

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:57:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23446">
    <title>[PATCH 4/4] mount command: remove local getport() implementation</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23446</link>
    <description>Eliminate local getport() implementation from utils/mount/network.c, as
it is no longer used.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 utils/mount/network.c |   76 +------------------------------------------------
 1 files changed, 2 insertions(+), 74 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 8d96e12..0c68993 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
&lt; at &gt;&lt; at &gt; -449,78 +449,6 &lt; at &gt;&lt; at &gt; err_connect:
 return RPC_ANYSOCK;
 }
 
-/*
- * getport() is very similar to pmap_getport() with the exception that
- * this version tries to use an ephemeral port, since reserved ports are
- * not needed for GETPORT queries.  This conserves the very limited
- * reserved port space, which helps reduce failed socket binds
- * during mount storms.
- *
- * A side effect of calling this function is that rpccreateerr is set.
- */
-static unsigned short getport(struct sockaddr_in *saddr,
-unsigned long program,
-unsigned long version,
-unsigned int proto)
-{
-struct sockaddr_in bind_saddr;
-unsigned short port = 0;
-int socket;
-CLIENT *clnt = NULL;
-enum clnt_stat stat;
- 
-bind_saddr = *saddr;
-bind_saddr.sin_port = htons(PMAPPORT);
-
-socket = get_socket(&amp;bind_saddr, proto, PMAP_TIMEOUT, FALSE, TRUE);
-if (socket == RPC_ANYSOCK) {
-if (proto == IPPROTO_TCP &amp;&amp;
-    rpc_createerr.cf_error.re_errno == ETIMEDOUT)
-rpc_createerr.cf_stat = RPC_TIMEDOUT;
-return 0;
-}
-
-switch (proto) {
-case IPPROTO_UDP:
-clnt = clntudp_bufcreate(&amp;bind_saddr,
- PMAPPROG, PMAPVERS,
- RETRY_TIMEOUT, &amp;socket,
- RPCSMALLMSGSIZE,
- RPCSMALLMSGSIZE);
-break;
-case IPPROTO_TCP:
-clnt = clnttcp_create(&amp;bind_saddr,
-      PMAPPROG, PMAPVERS,
-      &amp;socket,
-      RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
-break;
-}
-if (clnt != NULL) {
-struct pmap parms = {
-.pm_prog= program,
-.pm_vers= version,
-.pm_prot= proto,
-};
-
-stat = clnt_call(clnt, PMAPPROC_GETPORT,
- (xdrproc_t)xdr_pmap, (caddr_t)&amp;parms,
- (xdrproc_t)xdr_u_short, (caddr_t)&amp;port,
- TIMEOUT);
-if (stat) {
-clnt_geterr(clnt, &amp;rpc_createerr.cf_error);
-rpc_createerr.cf_stat = stat;
-}
-clnt_destroy(clnt);
-if (stat != RPC_SUCCESS)
-port = 0;
-else if (port == 0)
-rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED;
-}
-close(socket);
-
-return port;
-}
-
 static void nfs_pp_debug(const struct sockaddr *sap, const socklen_t salen,
  const rpcprog_t program, const rpcvers_t version,
  const unsigned short protocol,
&lt; at &gt;&lt; at &gt; -843,9 +771,9 &lt; at &gt;&lt; at &gt; void mnt_closeclnt(CLIENT *clnt, int msock)
  * &lt; at &gt;prot: target RPC protocol
  * &lt; at &gt;caddr: filled in with our network address
  *
- * Sigh... getport() doesn't actually check the version number.
+ * Sigh... GETPORT queries don't actually check the version number.
  * In order to make sure that the server actually supports the service
- * we're requesting, we open and RPC client, and fire off a NULL
+ * we're requesting, we open an RPC client, and fire off a NULL
  * RPC call.
  *
  * caddr is the network address that the server will use to call us back.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:48:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23445">
    <title>[PATCH 3/4] mount command: Replace clnt_ping() and getport() calls inprobe_port()</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23445</link>
    <description>Update the mount command's probe_port() function to call the new shared
rpcbind query and RPC ping functions.  This provides immediate support for
rpcbind v3/v4 queries, and paves the way for supporting AF_INET6 in the
probe_bothports() path.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 utils/mount/network.c |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 2231210..8d96e12 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
&lt; at &gt;&lt; at &gt; -521,6 +521,27 &lt; at &gt;&lt; at &gt; static unsigned short getport(struct sockaddr_in *saddr,
 return port;
 }
 
+static void nfs_pp_debug(const struct sockaddr *sap, const socklen_t salen,
+ const rpcprog_t program, const rpcvers_t version,
+ const unsigned short protocol,
+ const unsigned short port)
+{
+char buf[NI_MAXHOST];
+
+if (!verbose)
+return;
+
+if (nfs_present_sockaddr(sap, salen, buf, sizeof(buf)) == 0) {
+buf[0] = '\0';
+strcat(buf, "unknown host");
+}
+
+fprintf(stderr, _("%s: trying %s prog %ld vers %ld prot %s port %d\n"),
+progname, buf, program, version,
+(protocol == IPPROTO_UDP ? _("UDP") : _("TCP")),
+port);
+}
+
 /*
  * Use the portmapper to discover whether or not the service we want is
  * available. The lists 'versions' and 'protos' define ordered sequences
&lt; at &gt;&lt; at &gt; -529,7 +550,8 &lt; at &gt;&lt; at &gt; static unsigned short getport(struct sockaddr_in *saddr,
 static int probe_port(clnt_addr_t *server, const unsigned long *versions,
 const unsigned int *protos)
 {
-struct sockaddr_in *saddr = &amp;server-&gt;saddr;
+const struct sockaddr *saddr = (struct sockaddr *)&amp;server-&gt;saddr;
+const socklen_t salen = sizeof(server-&gt;saddr);
 struct pmap *pmap = &amp;server-&gt;pmap;
 const unsigned long prog = pmap-&gt;pm_prog, *p_vers;
 const unsigned int prot = (u_int)pmap-&gt;pm_prot, *p_prot;
&lt; at &gt;&lt; at &gt; -541,21 +563,14 &lt; at &gt;&lt; at &gt; static int probe_port(clnt_addr_t *server, const unsigned long *versions,
 p_vers = vers ? &amp;vers : versions;
 rpc_createerr.cf_stat = 0;
 for (;;) {
-p_port = getport(saddr, prog, *p_vers, *p_prot);
+p_port = nfs_getport(saddr, salen, prog, *p_vers, *p_prot);
 if (p_port) {
 if (!port || port == p_port) {
-saddr-&gt;sin_port = htons(p_port);
-if (verbose) {
-printf(_("%s: trying %s prog %ld vers "
-"%ld prot %s port %d\n"),
-progname,
-inet_ntoa(saddr-&gt;sin_addr),
-prog, *p_vers,
-*p_prot == IPPROTO_UDP ?
-_("UDP") : _("TCP"),
-p_port);
-                                }
-if (clnt_ping(saddr, prog, *p_vers, *p_prot, NULL))
+server-&gt;saddr.sin_port = htons(p_port);
+nfs_pp_debug(saddr, salen, prog, *p_vers,
+*p_prot, p_port);
+if (nfs_rpc_ping(saddr, salen, prog,
+*p_vers, *p_prot, NULL))
 goto out_ok;
 }
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:48:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23444">
    <title>[PATCH 2/4] mount command: Use nfs_error() instead of perror()</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23444</link>
    <description>So we can ensure that error output is directed appropriately, use
nfs_error() instead of perror() in start_statd().

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 utils/mount/network.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 0ba7bdb..2231210 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
&lt; at &gt;&lt; at &gt; -710,7 +710,8 &lt; at &gt;&lt; at &gt; int start_statd(void)
 execl(START_STATD, START_STATD, NULL);
 exit(1);
 case -1: /* error */
-perror("Fork failed");
+nfs_error(_("fork failed: %s"),
+strerror(errno));
 break;
 default: /* parent */
 waitpid(pid, NULL,0);

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:48:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23443">
    <title>[PATCH 1/4] mount command: Use nfs_pmap_getport() in probe_statd()</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23443</link>
    <description>Repace the getport() and clnt_ping() calls in probe_statd() with their
new shared equivalents.

Signed-off-by: Chuck Lever &lt;chuck.lever-QHcLZuEGTsvQT0dZR+AlfA&lt; at &gt;public.gmane.org&gt;
---

 utils/mount/network.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 806344c..0ba7bdb 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
&lt; at &gt;&lt; at &gt; -47,6 +47,7 &lt; at &gt;&lt; at &gt;
 #include "nls.h"
 #include "nfs_mount.h"
 #include "mount_constants.h"
+#include "nfsrpc.h"
 #include "network.h"
 
 /*
&lt; at &gt;&lt; at &gt; -79,6 +80,11 &lt; at &gt;&lt; at &gt; extern int nfs_mount_data_version;
 extern char *progname;
 extern int verbose;
 
+static const char *nfs_ns_pgmtbl[] = {
+"status",
+NULL,
+};
+
 static const unsigned long nfs_to_mnt[] = {
 0,
 0,
&lt; at &gt;&lt; at &gt; -669,24 +675,16 &lt; at &gt;&lt; at &gt; version_fixed:
 return probe_mntport(mnt_server);
 }
 
-static int probe_statd(void)
+static int nfs_probe_statd(void)
 {
-struct sockaddr_in addr;
-unsigned short port;
-
-memset(&amp;addr, 0, sizeof(addr));
-addr.sin_family = AF_INET;
-addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-port = getport(&amp;addr, 100024, 1, IPPROTO_UDP);
-
-if (port == 0)
-return 0;
-addr.sin_port = htons(port);
-
-if (clnt_ping(&amp;addr, 100024, 1, IPPROTO_UDP, NULL) &lt;= 0)
-return 0;
+struct sockaddr_in addr = {
+.sin_family= AF_INET,
+.sin_addr.s_addr= htonl(INADDR_LOOPBACK),
+};
+rpcprog_t program = nfs_getrpcbyname(NSMPROG, nfs_ns_pgmtbl);
 
-return 1;
+return nfs_getport_ping((struct sockaddr *)&amp;addr, sizeof(addr),
+program, (rpcvers_t)1, IPPROTO_UDP);
 }
 
 /**
&lt; at &gt;&lt; at &gt; -700,7 +698,7 &lt; at &gt;&lt; at &gt; int start_statd(void)
 struct stat stb;
 #endif
 
-if (probe_statd())
+if (nfs_probe_statd())
 return 1;
 
 #ifdef START_STATD
&lt; at &gt;&lt; at &gt; -718,7 +716,7 &lt; at &gt;&lt; at &gt; int start_statd(void)
 waitpid(pid, NULL,0);
 break;
 }
-if (probe_statd())
+if (nfs_probe_statd())
 return 1;
 }
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:48:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23442">
    <title>[PATCH 0/4] Make mount.nfs use new getport() function</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23442</link>
    <description>Hi Steve-

Four new IPv6-related patches for mount.nfs.  These replace the
existing PMAP_GETPORT implementation in utils/mount/network.c with a
call to the new library functions we just added.

The probe_statd() function is used by both the legacy and the text-
based paths, but replacing the mount.nfs command's getport() function
affects only the *legacy* NFS mount path, not text-based mounts.

For anyone testing this code, please try it on pre-2.6.23 kernels,
or patch mount.nfs to use legacy binary style mounts.  This will
exercise the new PMAP_GETPORT implementation using all the special
cases needed by mount.nfs.

The new RPCB_GETADDR implementation will not be used until mount.nfs
can pass in IPv6 addresses.

---

Chuck Lever (4):
      mount command: remove local getport() implementation
      mount command: Replace clnt_ping() and getport() calls in probe_port()
      mount command: Use nfs_error() instead of perror()
      mount command: Use nfs_pmap_getport() in probe_statd()


 utils/mount/network.c |  144 +++++++++++++++----------------------------------
 1 files changed, 43 insertions(+), 101 deletions(-)

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:48:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23441">
    <title>Re: ipv6 status</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23441</link>
    <description>
Indeed.  :-)

Thanx for the update.  Looking forward to it finally finishing.

b.

</description>
    <dc:creator>Brian J. Murrell</dc:creator>
    <dc:date>2008-12-01T18:40:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23440">
    <title>Re: ipv6 status</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23440</link>
    <description>
There isn't a published roadmap.  Linux developers tend to eschew  
deadlines.

The NFS client in 2.6.28 (and maybe 2.6.27) should support NFSv4 over  
IPv6.  Use the latest nfs-utils.

I'm hoping 2.6.29 will see all the kernel pieces we need for NFSv2/v3  
client and server, and NFSv4 server support for IPv6.

Support for NFSv2/v3 over IPv6, and server-side support for NFSv4 over  
IPv6, requires user space changes.  We are pushing those into nfs- 
utils over time, but I don't expect that work to be complete until  
sometime in 1H2009.

</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T18:33:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.nfs/23439">
    <title>Fwd: nfs related backtrace. (.27.5)</title>
    <link>http://permalink.gmane.org/gmane.linux.nfs/23439</link>
    <description>Forwarding to linux-nfs-u79uwXL29TY76Z2rM5mHXA&lt; at &gt;public.gmane.org

Begin forwarded message:


</description>
    <dc:creator>Chuck Lever</dc:creator>
    <dc:date>2008-12-01T17:47:47</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.linux.nfs">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.nfs</link>
  </textinput>
</rdf:RDF>
