linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
@ 2012-09-24 17:39 bjschuma
  2012-09-24 17:42 ` J. Bruce Fields
  2012-10-19 19:39 ` J. Bruce Fields
  0 siblings, 2 replies; 12+ messages in thread
From: bjschuma @ 2012-09-24 17:39 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs

From: Bryan Schumaker <bjschuma@netapp.com>

f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
regression) introduced the "alloc_slot" function for xprt operations,
but never created one for the backchannel operations.  This patch fixes
a null pointer dereference when mounting NFS over v4.1.

Call Trace:
 [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
 [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
 [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
 [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
 [<ffffffff81073589>] process_one_work+0x139/0x500
 [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
 [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
 [<ffffffff81073d1e>] worker_thread+0x15e/0x460
 [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
 [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
 [<ffffffff81079603>] kthread+0x93/0xa0
 [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
 [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
 [<ffffffff81465d00>] ? gs_change+0x13/0x13

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 net/sunrpc/xprtsock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 86b7777..aaaadfb 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
 static struct rpc_xprt_ops bc_tcp_ops = {
 	.reserve_xprt		= xprt_reserve_xprt,
 	.release_xprt		= xprt_release_xprt,
+	.alloc_slot		= xprt_alloc_slot,
 	.rpcbind		= xs_local_rpcbind,
 	.buf_alloc		= bc_malloc,
 	.buf_free		= bc_free,
-- 
1.7.12.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-09-24 17:39 [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops bjschuma
@ 2012-09-24 17:42 ` J. Bruce Fields
  2012-09-24 17:52   ` Bryan Schumaker
  2012-10-19 19:39 ` J. Bruce Fields
  1 sibling, 1 reply; 12+ messages in thread
From: J. Bruce Fields @ 2012-09-24 17:42 UTC (permalink / raw)
  To: bjschuma; +Cc: Trond.Myklebust, linux-nfs

On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
> From: Bryan Schumaker <bjschuma@netapp.com>
> 
> f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
> regression) introduced the "alloc_slot" function for xprt operations,
> but never created one for the backchannel operations.  This patch fixes
> a null pointer dereference when mounting NFS over v4.1.

Thanks, I just rebased some of my work to 3.6 and ran across that!  It
crashes the 4.1 server very quickly....

--b.

> 
> Call Trace:
>  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
>  [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
>  [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
>  [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
>  [<ffffffff81073589>] process_one_work+0x139/0x500
>  [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
>  [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
>  [<ffffffff81073d1e>] worker_thread+0x15e/0x460
>  [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
>  [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
>  [<ffffffff81079603>] kthread+0x93/0xa0
>  [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
>  [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
>  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> 
> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> ---
>  net/sunrpc/xprtsock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 86b7777..aaaadfb 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
>  static struct rpc_xprt_ops bc_tcp_ops = {
>  	.reserve_xprt		= xprt_reserve_xprt,
>  	.release_xprt		= xprt_release_xprt,
> +	.alloc_slot		= xprt_alloc_slot,
>  	.rpcbind		= xs_local_rpcbind,
>  	.buf_alloc		= bc_malloc,
>  	.buf_free		= bc_free,
> -- 
> 1.7.12.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-09-24 17:42 ` J. Bruce Fields
@ 2012-09-24 17:52   ` Bryan Schumaker
  2012-09-24 19:31     ` Myklebust, Trond
  0 siblings, 1 reply; 12+ messages in thread
From: Bryan Schumaker @ 2012-09-24 17:52 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Trond.Myklebust, linux-nfs

On 09/24/2012 01:42 PM, J. Bruce Fields wrote:
> On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
>> From: Bryan Schumaker <bjschuma@netapp.com>
>>
>> f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
>> regression) introduced the "alloc_slot" function for xprt operations,
>> but never created one for the backchannel operations.  This patch fixes
>> a null pointer dereference when mounting NFS over v4.1.
> 
> Thanks, I just rebased some of my work to 3.6 and ran across that!  It
> crashes the 4.1 server very quickly....

That sounds like my story.  It got my peer-to-peer server right away, too.

- Bryan

> 
> --b.
> 
>>
>> Call Trace:
>>  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
>>  [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
>>  [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
>>  [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
>>  [<ffffffff81073589>] process_one_work+0x139/0x500
>>  [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
>>  [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
>>  [<ffffffff81073d1e>] worker_thread+0x15e/0x460
>>  [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
>>  [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
>>  [<ffffffff81079603>] kthread+0x93/0xa0
>>  [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
>>  [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
>>  [<ffffffff81465d00>] ? gs_change+0x13/0x13
>>
>> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
>> ---
>>  net/sunrpc/xprtsock.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
>> index 86b7777..aaaadfb 100644
>> --- a/net/sunrpc/xprtsock.c
>> +++ b/net/sunrpc/xprtsock.c
>> @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
>>  static struct rpc_xprt_ops bc_tcp_ops = {
>>  	.reserve_xprt		= xprt_reserve_xprt,
>>  	.release_xprt		= xprt_release_xprt,
>> +	.alloc_slot		= xprt_alloc_slot,
>>  	.rpcbind		= xs_local_rpcbind,
>>  	.buf_alloc		= bc_malloc,
>>  	.buf_free		= bc_free,
>> -- 
>> 1.7.12.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-09-24 17:52   ` Bryan Schumaker
@ 2012-09-24 19:31     ` Myklebust, Trond
  2012-09-25 19:08       ` J. Bruce Fields
  0 siblings, 1 reply; 12+ messages in thread
From: Myklebust, Trond @ 2012-09-24 19:31 UTC (permalink / raw)
  To: Schumaker, Bryan; +Cc: J. Bruce Fields, linux-nfs@vger.kernel.org

T24gTW9uLCAyMDEyLTA5LTI0IGF0IDEzOjUyIC0wNDAwLCBCcnlhbiBTY2h1bWFrZXIgd3JvdGU6
DQo+IE9uIDA5LzI0LzIwMTIgMDE6NDIgUE0sIEouIEJydWNlIEZpZWxkcyB3cm90ZToNCj4gPiBP
biBNb24sIFNlcCAyNCwgMjAxMiBhdCAwMTozOTowMVBNIC0wNDAwLCBianNjaHVtYUBuZXRhcHAu
Y29tIHdyb3RlOg0KPiA+PiBGcm9tOiBCcnlhbiBTY2h1bWFrZXIgPGJqc2NodW1hQG5ldGFwcC5j
b20+DQo+ID4+DQo+ID4+IGYzOWMxYmZiNWEwM2UyZDI1NTQ1MWJmZjA1YmUwZDcyNTUyOThmYTQg
KFNVTlJQQzogRml4IGEgVURQIHRyYW5zcG9ydA0KPiA+PiByZWdyZXNzaW9uKSBpbnRyb2R1Y2Vk
IHRoZSAiYWxsb2Nfc2xvdCIgZnVuY3Rpb24gZm9yIHhwcnQgb3BlcmF0aW9ucywNCj4gPj4gYnV0
IG5ldmVyIGNyZWF0ZWQgb25lIGZvciB0aGUgYmFja2NoYW5uZWwgb3BlcmF0a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gY29kZSB0byBiZSBldmVuIG1vcmUgY29u
ZnVzaW5nIHRoYW4NCmxvY2tkLg0KDQouLi5hbmQgQlRXIHRoZSAucnBjYmluZCBoYWNrIGFib3Zl
IGlzIGEgcHJpbWUgZXhhbXBsZS4gQnJ1Y2UsIHdoeSBkbyB5b3UNCm5lZWQgdGhhdD8gVGhlIHNl
cnZlciBiYWNrIGNoYW5uZWwgc2V0cyB4cHJ0X3NldF9ib3VuZCgpIGluDQp4c19zZXR1cF9iY190
Y3AoKSBhbmQgc2hvdWxkIG5ldmVyIGNsZWFyIGl0Lg0KDQotLSANClRyb25kIE15a2xlYnVzdA0K
TGludXggTkZTIGNsaWVudCBtYWludGFpbmVyDQoNCk5ldEFwcA0KVHJvbmQuTXlrbGVidXN0QG5l
dGFwcC5jb20NCnd3dy5uZXRhcHAuY29tDQo=

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-09-24 19:31     ` Myklebust, Trond
@ 2012-09-25 19:08       ` J. Bruce Fields
  0 siblings, 0 replies; 12+ messages in thread
From: J. Bruce Fields @ 2012-09-25 19:08 UTC (permalink / raw)
  To: Myklebust, Trond; +Cc: Schumaker, Bryan, linux-nfs@vger.kernel.org

On Mon, Sep 24, 2012 at 07:31:23PM +0000, Myklebust, Trond wrote:
> On Mon, 2012-09-24 at 13:52 -0400, Bryan Schumaker wrote:
> > On 09/24/2012 01:42 PM, J. Bruce Fields wrote:
> > > On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
> > >> From: Bryan Schumaker <bjschuma@netapp.com>
> > >>
> > >> f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
> > >> regression) introduced the "alloc_slot" function for xprt operations,
> > >> but never created one for the backchannel operations.  This patch fixes
> > >> a null pointer dereference when mounting NFS over v4.1.
> > > 
> > > Thanks, I just rebased some of my work to 3.6 and ran across that!  It
> > > crashes the 4.1 server very quickly....
> > 
> > That sounds like my story.  It got my peer-to-peer server right away, too.
> > 
> > - Bryan
> > 
> > > 
> > > --b.
> > > 
> > >>
> > >> Call Trace:
> > >>  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
> > >>  [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
> > >>  [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
> > >>  [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
> > >>  [<ffffffff81073589>] process_one_work+0x139/0x500
> > >>  [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
> > >>  [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
> > >>  [<ffffffff81073d1e>] worker_thread+0x15e/0x460
> > >>  [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
> > >>  [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
> > >>  [<ffffffff81079603>] kthread+0x93/0xa0
> > >>  [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
> > >>  [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
> > >>  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> > >>
> > >> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> > >> ---
> > >>  net/sunrpc/xprtsock.c | 1 +
> > >>  1 file changed, 1 insertion(+)
> > >>
> > >> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> > >> index 86b7777..aaaadfb 100644
> > >> --- a/net/sunrpc/xprtsock.c
> > >> +++ b/net/sunrpc/xprtsock.c
> > >> @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
> > >>  static struct rpc_xprt_ops bc_tcp_ops = {
> > >>  	.reserve_xprt		= xprt_reserve_xprt,
> > >>  	.release_xprt		= xprt_release_xprt,
> > >> +	.alloc_slot		= xprt_alloc_slot,
> > >>  	.rpcbind		= xs_local_rpcbind,
> > >>  	.buf_alloc		= bc_malloc,
> > >>  	.buf_free		= bc_free,
> > >> -- 
> > >> 1.7.12.1
> > >>
> > >> --
> > >> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > >> the body of a message to majordomo@vger.kernel.org
> > >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> 
> Argh... Sorry, that was entirely my fault. I traced the client side
> backchannel code, and found it was allocating slots using its own
> mechanism, then thought that applied to bc_tcp_ops.
> 
> I find the NFSv4.1 backchannel code to be even more confusing than
> lockd.

Patches very much welcomed.

> ...and BTW the .rpcbind hack above is a prime example. Bruce, why do you
> need that? The server back channel sets xprt_set_bound() in
> xs_setup_bc_tcp() and should never clear it.

Beats me; you're suggesting the below?  Agreed, looks wrong.

It must be pointless in the AF_LOCAL case too, though I didn't try to
verify.

--b.

commit ad25de5558f702fa2c7ececedf4d61975dababa8
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Mon Sep 24 15:53:29 2012 -0400

    sunrpc: server back channel needs no rpcbind method
    
    XPRT_BOUND is set on server backchannel xprts by xs_setup_bc_tcp()
    (using xprt_set_bound()), and is never cleared, so ->rpcbind() will
    never need to be called.
    
    Reported-by: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index cd59a80..3a8663e6 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2529,7 +2529,6 @@ static struct rpc_xprt_ops bc_tcp_ops = {
 	.reserve_xprt		= xprt_reserve_xprt,
 	.release_xprt		= xprt_release_xprt,
 	.alloc_slot		= xprt_alloc_slot,
-	.rpcbind		= xs_local_rpcbind,
 	.buf_alloc		= bc_malloc,
 	.buf_free		= bc_free,
 	.send_request		= bc_send_request,

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-09-24 17:39 [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops bjschuma
  2012-09-24 17:42 ` J. Bruce Fields
@ 2012-10-19 19:39 ` J. Bruce Fields
  2012-10-19 20:23   ` Myklebust, Trond
  2012-10-27 23:25   ` Ben Hutchings
  1 sibling, 2 replies; 12+ messages in thread
From: J. Bruce Fields @ 2012-10-19 19:39 UTC (permalink / raw)
  To: bjschuma; +Cc: Trond.Myklebust, linux-nfs, stable

Did this not get sent to stable?  (Now upstream as
84e28a307e376f271505af65a7b7e212dd6f61f4.)

--b.

On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
> From: Bryan Schumaker <bjschuma@netapp.com>
> 
> f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
> regression) introduced the "alloc_slot" function for xprt operations,
> but never created one for the backchannel operations.  This patch fixes
> a null pointer dereference when mounting NFS over v4.1.
> 
> Call Trace:
>  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
>  [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
>  [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
>  [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
>  [<ffffffff81073589>] process_one_work+0x139/0x500
>  [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
>  [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
>  [<ffffffff81073d1e>] worker_thread+0x15e/0x460
>  [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
>  [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
>  [<ffffffff81079603>] kthread+0x93/0xa0
>  [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
>  [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
>  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> 
> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> ---
>  net/sunrpc/xprtsock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 86b7777..aaaadfb 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
>  static struct rpc_xprt_ops bc_tcp_ops = {
>  	.reserve_xprt		= xprt_reserve_xprt,
>  	.release_xprt		= xprt_release_xprt,
> +	.alloc_slot		= xprt_alloc_slot,
>  	.rpcbind		= xs_local_rpcbind,
>  	.buf_alloc		= bc_malloc,
>  	.buf_free		= bc_free,
> -- 
> 1.7.12.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-10-19 19:39 ` J. Bruce Fields
@ 2012-10-19 20:23   ` Myklebust, Trond
  2012-10-19 21:01     ` J. Bruce Fields
  2012-10-27 23:25   ` Ben Hutchings
  1 sibling, 1 reply; 12+ messages in thread
From: Myklebust, Trond @ 2012-10-19 20:23 UTC (permalink / raw)
  To: J. Bruce Fields, Schumaker, Bryan
  Cc: linux-nfs@vger.kernel.org, stable@vger.kernel.org


Et tu Bruce?

Not yet, because if you check, neither has commit f39c1bfb5a (SUNRPC: Fix a UDP transport regression). I figured it is better to send them both together as a single patch.

Trond

> -----Original Message-----
> From: J. Bruce Fields [mailto:bfields@fieldses.org]
> Sent: Friday, October 19, 2012 3:40 PM
> To: Schumaker, Bryan
> Cc: Myklebust, Trond; linux-nfs@vger.kernel.org; stable@vger.kernel.org
> Subject: Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
> 
> Did this not get sent to stable?  (Now upstream as
> 84e28a307e376f271505af65a7b7e212dd6f61f4.)
> 
> --b.
> 
> On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
> > From: Bryan Schumaker <bjschuma@netapp.com>
> >
> > f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP
> transport
> > regression) introduced the "alloc_slot" function for xprt operations,
> > but never created one for the backchannel operations.  This patch
> > fixes a null pointer dereference when mounting NFS over v4.1.
> >
> > Call Trace:
> >  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
> > [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
> > [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
> > [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
> > [<ffffffff81073589>] process_one_work+0x139/0x500
> > [<ffffffff81070e70>] ? alloc_worker+0x70/0x70  [<ffffffffa020e5f0>] ?
> > __rpc_execute+0x400/0x400 [sunrpc]  [<ffffffff81073d1e>]
> > worker_thread+0x15e/0x460  [<ffffffff8145c839>] ?
> > preempt_schedule+0x49/0x70  [<ffffffff81073bc0>] ?
> > rescuer_thread+0x230/0x230  [<ffffffff81079603>] kthread+0x93/0xa0
> > [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
> > [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
> >  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> >
> > Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> > ---
> >  net/sunrpc/xprtsock.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index
> > 86b7777..aaaadfb 100644
> > --- a/net/sunrpc/xprtsock.c
> > +++ b/net/sunrpc/xprtsock.c
> > @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
> > static struct rpc_xprt_ops bc_tcp_ops = {
> >  	.reserve_xprt		= xprt_reserve_xprt,
> >  	.release_xprt		= xprt_release_xprt,
> > +	.alloc_slot		= xprt_alloc_slot,
> >  	.rpcbind		= xs_local_rpcbind,
> >  	.buf_alloc		= bc_malloc,
> >  	.buf_free		= bc_free,
> > --
> > 1.7.12.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs"
> > in the body of a message to majordomo@vger.kernel.org More
> majordomo
> > info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-10-19 20:23   ` Myklebust, Trond
@ 2012-10-19 21:01     ` J. Bruce Fields
  2012-10-19 21:05       ` Myklebust, Trond
  0 siblings, 1 reply; 12+ messages in thread
From: J. Bruce Fields @ 2012-10-19 21:01 UTC (permalink / raw)
  To: Myklebust, Trond
  Cc: Schumaker, Bryan, linux-nfs@vger.kernel.org,
	stable@vger.kernel.org

On Fri, Oct 19, 2012 at 08:23:05PM +0000, Myklebust, Trond wrote:
> 
> Et tu Bruce?
> 
> Not yet, because if you check, neither has commit f39c1bfb5a (SUNRPC: Fix a UDP transport regression). I figured it is better to send them both together as a single patch.

I'm confused, I thought I did check.  Looking again...  It's in 3.6:

	$ git log v3.6..f39c1bfb5a
	$ 

and cc'd to stable:

	$ git show f39c1bfb5a|grep stable
	    Cc: stable@vger.kernel.org [>= 3.1]

so presumably it's already on its way to older stable branches too.

--b.

> 
> Trond
> 
> > -----Original Message-----
> > From: J. Bruce Fields [mailto:bfields@fieldses.org]
> > Sent: Friday, October 19, 2012 3:40 PM
> > To: Schumaker, Bryan
> > Cc: Myklebust, Trond; linux-nfs@vger.kernel.org; stable@vger.kernel.org
> > Subject: Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
> > 
> > Did this not get sent to stable?  (Now upstream as
> > 84e28a307e376f271505af65a7b7e212dd6f61f4.)
> > 
> > --b.
> > 
> > On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com wrote:
> > > From: Bryan Schumaker <bjschuma@netapp.com>
> > >
> > > f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP
> > transport
> > > regression) introduced the "alloc_slot" function for xprt operations,
> > > but never created one for the backchannel operations.  This patch
> > > fixes a null pointer dereference when mounting NFS over v4.1.
> > >
> > > Call Trace:
> > >  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
> > > [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
> > > [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
> > > [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
> > > [<ffffffff81073589>] process_one_work+0x139/0x500
> > > [<ffffffff81070e70>] ? alloc_worker+0x70/0x70  [<ffffffffa020e5f0>] ?
> > > __rpc_execute+0x400/0x400 [sunrpc]  [<ffffffff81073d1e>]
> > > worker_thread+0x15e/0x460  [<ffffffff8145c839>] ?
> > > preempt_schedule+0x49/0x70  [<ffffffff81073bc0>] ?
> > > rescuer_thread+0x230/0x230  [<ffffffff81079603>] kthread+0x93/0xa0
> > > [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
> > > [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
> > >  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> > >
> > > Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> > > ---
> > >  net/sunrpc/xprtsock.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index
> > > 86b7777..aaaadfb 100644
> > > --- a/net/sunrpc/xprtsock.c
> > > +++ b/net/sunrpc/xprtsock.c
> > > @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
> > > static struct rpc_xprt_ops bc_tcp_ops = {
> > >  	.reserve_xprt		= xprt_reserve_xprt,
> > >  	.release_xprt		= xprt_release_xprt,
> > > +	.alloc_slot		= xprt_alloc_slot,
> > >  	.rpcbind		= xs_local_rpcbind,
> > >  	.buf_alloc		= bc_malloc,
> > >  	.buf_free		= bc_free,
> > > --
> > > 1.7.12.1
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-nfs"
> > > in the body of a message to majordomo@vger.kernel.org More
> > majordomo
> > > info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-10-19 21:01     ` J. Bruce Fields
@ 2012-10-19 21:05       ` Myklebust, Trond
  2012-10-19 21:11         ` J. Bruce Fields
  0 siblings, 1 reply; 12+ messages in thread
From: Myklebust, Trond @ 2012-10-19 21:05 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Schumaker, Bryan, linux-nfs@vger.kernel.org,
	stable@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 3781 bytes --]

> -----Original Message-----
> From: J. Bruce Fields [mailto:bfields@fieldses.org]
> Sent: Friday, October 19, 2012 5:01 PM
> To: Myklebust, Trond
> Cc: Schumaker, Bryan; linux-nfs@vger.kernel.org; stable@vger.kernel.org
> Subject: Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
> 
> On Fri, Oct 19, 2012 at 08:23:05PM +0000, Myklebust, Trond wrote:
> >
> > Et tu Bruce?
> >
> > Not yet, because if you check, neither has commit f39c1bfb5a (SUNRPC: Fix
> a UDP transport regression). I figured it is better to send them both together
> as a single patch.
> 
> I'm confused, I thought I did check.  Looking again...  It's in 3.6:
> 
> 	$ git log v3.6..f39c1bfb5a
> 	$

Yes. 3.6 still has the original patch+problem.

> and cc'd to stable:
> 
> 	$ git show f39c1bfb5a|grep stable
> 	    Cc: stable@vger.kernel.org [>= 3.1]
> 
> so presumably it's already on its way to older stable branches too.

No. See attachment... 

 
> >
> > Trond
> >
> > > -----Original Message-----
> > > From: J. Bruce Fields [mailto:bfields@fieldses.org]
> > > Sent: Friday, October 19, 2012 3:40 PM
> > > To: Schumaker, Bryan
> > > Cc: Myklebust, Trond; linux-nfs@vger.kernel.org;
> > > stable@vger.kernel.org
> > > Subject: Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
> > >
> > > Did this not get sent to stable?  (Now upstream as
> > > 84e28a307e376f271505af65a7b7e212dd6f61f4.)
> > >
> > > --b.
> > >
> > > On Mon, Sep 24, 2012 at 01:39:01PM -0400, bjschuma@netapp.com
> wrote:
> > > > From: Bryan Schumaker <bjschuma@netapp.com>
> > > >
> > > > f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP
> > > transport
> > > > regression) introduced the "alloc_slot" function for xprt
> > > > operations, but never created one for the backchannel operations.
> > > > This patch fixes a null pointer dereference when mounting NFS over
> v4.1.
> > > >
> > > > Call Trace:
> > > >  [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
> > > > [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
> > > > [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
> > > > [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
> > > > [<ffffffff81073589>] process_one_work+0x139/0x500
> > > > [<ffffffff81070e70>] ? alloc_worker+0x70/0x70  [<ffffffffa020e5f0>] ?
> > > > __rpc_execute+0x400/0x400 [sunrpc]  [<ffffffff81073d1e>]
> > > > worker_thread+0x15e/0x460  [<ffffffff8145c839>] ?
> > > > preempt_schedule+0x49/0x70  [<ffffffff81073bc0>] ?
> > > > rescuer_thread+0x230/0x230  [<ffffffff81079603>] kthread+0x93/0xa0
> > > > [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
> > > > [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
> > > >  [<ffffffff81465d00>] ? gs_change+0x13/0x13
> > > >
> > > > Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> > > > ---
> > > >  net/sunrpc/xprtsock.c | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index
> > > > 86b7777..aaaadfb 100644
> > > > --- a/net/sunrpc/xprtsock.c
> > > > +++ b/net/sunrpc/xprtsock.c
> > > > @@ -2521,6 +2521,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
> > > > static struct rpc_xprt_ops bc_tcp_ops = {
> > > >  	.reserve_xprt		= xprt_reserve_xprt,
> > > >  	.release_xprt		= xprt_release_xprt,
> > > > +	.alloc_slot		= xprt_alloc_slot,
> > > >  	.rpcbind		= xs_local_rpcbind,
> > > >  	.buf_alloc		= bc_malloc,
> > > >  	.buf_free		= bc_free,
> > > > --
> > > > 1.7.12.1
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-nfs"
> > > > in the body of a message to majordomo@vger.kernel.org More
> > > majordomo
> > > > info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Type: message/rfc822, Size: 2631 bytes --]

From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "stable@vger.kernel.org" <stable@vger.kernel.org>, "alan@lxorguk.ukuu.org.uk" <alan@lxorguk.ukuu.org.uk>, Dick Streefland <dick.streefland@altium.nl>
Subject: Re: [ 070/218] SUNRPC: Fix a UDP transport regression
Date: Fri, 28 Sep 2012 20:29:38 +0000
Message-ID: <1348864178.4297.18.camel@lade.trondhjem.org>

On Fri, 2012-09-28 at 13:14 -0700, Greg Kroah-Hartman wrote:
> 3.4-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Trond Myklebust <Trond.Myklebust@netapp.com>
>
> commit f39c1bfb5a03e2d255451bff05be0d7255298fa4 upstream.
>
> Commit 43cedbf0e8dfb9c5610eb7985d5f21263e313802 (SUNRPC: Ensure that
> we grab the XPRT_LOCK before calling xprt_alloc_slot) is causing
> hangs in the case of NFS over UDP mounts.

Ditto with this. Please hold this patch until the 1 line fix mentioned
previously has been merged upstream (at which point I will resend the
patch through stable@vger.kernel.org).

Thanks!
  Trond

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-10-19 21:05       ` Myklebust, Trond
@ 2012-10-19 21:11         ` J. Bruce Fields
  0 siblings, 0 replies; 12+ messages in thread
From: J. Bruce Fields @ 2012-10-19 21:11 UTC (permalink / raw)
  To: Myklebust, Trond
  Cc: Schumaker, Bryan, linux-nfs@vger.kernel.org,
	stable@vger.kernel.org

On Fri, Oct 19, 2012 at 09:05:08PM +0000, Myklebust, Trond wrote:
> > -----Original Message-----
> > From: J. Bruce Fields [mailto:bfields@fieldses.org]
> > Sent: Friday, October 19, 2012 5:01 PM
> > To: Myklebust, Trond
> > Cc: Schumaker, Bryan; linux-nfs@vger.kernel.org; stable@vger.kernel.org
> > Subject: Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
> > 
> > On Fri, Oct 19, 2012 at 08:23:05PM +0000, Myklebust, Trond wrote:
> > >
> > > Et tu Bruce?
> > >
> > > Not yet, because if you check, neither has commit f39c1bfb5a (SUNRPC: Fix
> > a UDP transport regression). I figured it is better to send them both together
> > as a single patch.
> > 
> > I'm confused, I thought I did check.  Looking again...  It's in 3.6:
> > 
> > 	$ git log v3.6..f39c1bfb5a
> > 	$
> 
> Yes. 3.6 still has the original patch+problem.
> 
> > and cc'd to stable:
> > 
> > 	$ git show f39c1bfb5a|grep stable
> > 	    Cc: stable@vger.kernel.org [>= 3.1]
> > 
> > so presumably it's already on its way to older stable branches too.
> 
> No. See attachment... 

OK.  As long as it makes it to 3.6.x one way or another, I'm happy....

--b.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
@ 2012-10-22 16:35 Trond Myklebust
  0 siblings, 0 replies; 12+ messages in thread
From: Trond Myklebust @ 2012-10-22 16:35 UTC (permalink / raw)
  To: stable; +Cc: linux-nfs, Bryan Schumaker

From: Bryan Schumaker <bjschuma@netapp.com>

commit 84e28a307e376f271505af65a7b7e212dd6f61f4 upstream.

f39c1bfb5a03e2d255451bff05be0d7255298fa4 (SUNRPC: Fix a UDP transport
regression) introduced the "alloc_slot" function for xprt operations,
but never created one for the backchannel operations.  This patch fixes
a null pointer dereference when mounting NFS over v4.1.

Call Trace:
 [<ffffffffa0207957>] ? xprt_reserve+0x47/0x50 [sunrpc]
 [<ffffffffa02023a4>] call_reserve+0x34/0x60 [sunrpc]
 [<ffffffffa020e280>] __rpc_execute+0x90/0x400 [sunrpc]
 [<ffffffffa020e61a>] rpc_async_schedule+0x2a/0x40 [sunrpc]
 [<ffffffff81073589>] process_one_work+0x139/0x500
 [<ffffffff81070e70>] ? alloc_worker+0x70/0x70
 [<ffffffffa020e5f0>] ? __rpc_execute+0x400/0x400 [sunrpc]
 [<ffffffff81073d1e>] worker_thread+0x15e/0x460
 [<ffffffff8145c839>] ? preempt_schedule+0x49/0x70
 [<ffffffff81073bc0>] ? rescuer_thread+0x230/0x230
 [<ffffffff81079603>] kthread+0x93/0xa0
 [<ffffffff81465d04>] kernel_thread_helper+0x4/0x10
 [<ffffffff81079570>] ? kthread_freezable_should_stop+0x70/0x70
 [<ffffffff81465d00>] ? gs_change+0x13/0x13

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

Please apply to linux 3.6.3 only. A separate patch will be sent for
older kernels.

Cheers
  Trond

 net/sunrpc/xprtsock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index d1988cf..97f8918 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2539,6 +2539,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
 static struct rpc_xprt_ops bc_tcp_ops = {
 	.reserve_xprt		= xprt_reserve_xprt,
 	.release_xprt		= xprt_release_xprt,
+	.alloc_slot		= xprt_alloc_slot,
 	.rpcbind		= xs_local_rpcbind,
 	.buf_alloc		= bc_malloc,
 	.buf_free		= bc_free,
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops
  2012-10-19 19:39 ` J. Bruce Fields
  2012-10-19 20:23   ` Myklebust, Trond
@ 2012-10-27 23:25   ` Ben Hutchings
  1 sibling, 0 replies; 12+ messages in thread
From: Ben Hutchings @ 2012-10-27 23:25 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: bjschuma, Trond.Myklebust, linux-nfs, stable

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

On Fri, 2012-10-19 at 15:39 -0400, J. Bruce Fields wrote:
> Did this not get sent to stable?  (Now upstream as
> 84e28a307e376f271505af65a7b7e212dd6f61f4.)
[...]

I've added this to the queue for 3.2.

Ben.

-- 
Ben Hutchings
Reality is just a crutch for people who can't handle science fiction.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-10-27 23:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 17:39 [PATCH] SUNRPC: Set alloc_slot for backchannel tcp ops bjschuma
2012-09-24 17:42 ` J. Bruce Fields
2012-09-24 17:52   ` Bryan Schumaker
2012-09-24 19:31     ` Myklebust, Trond
2012-09-25 19:08       ` J. Bruce Fields
2012-10-19 19:39 ` J. Bruce Fields
2012-10-19 20:23   ` Myklebust, Trond
2012-10-19 21:01     ` J. Bruce Fields
2012-10-19 21:05       ` Myklebust, Trond
2012-10-19 21:11         ` J. Bruce Fields
2012-10-27 23:25   ` Ben Hutchings
  -- strict thread matches above, loose matches on Subject: below --
2012-10-22 16:35 Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).