* [PATCH 0/1] NFSv4.0 reclaim reboot state when re-establishing clientid
@ 2012-09-28 21:05 andros
2012-09-28 21:05 ` [PATCH 1/1] " andros
0 siblings, 1 reply; 4+ messages in thread
From: andros @ 2012-09-28 21:05 UTC (permalink / raw)
To: trond.myklebust; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
This patch fixes an infinite loop where a file is open during a reboot, and
written to after the reboot. NFS4ERR_BADSESSION is intially returned, and
first the session, and then the clientid are re-established. But since the
open state was not recovered, the write after reboot would use the old stateid.
The server then returns NFS4ERR_STALE_STATEID as it should, and the client
then goes into the NFS4CLNT_CHECK_LEASE state which sends a solo sequence
operation to check the lease. Since the clientid/session has been
re-established, the NFS4CLNT_CHECK_LEASE does not receive an error, and the
write is resent with the old stateid.....
-->Andy
Andy Adamson (1):
NFSv4.0 reclaim reboot state when re-establishing clientid
fs/nfs/nfs4state.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
--
1.7.7.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] NFSv4.0 reclaim reboot state when re-establishing clientid
2012-09-28 21:05 [PATCH 0/1] NFSv4.0 reclaim reboot state when re-establishing clientid andros
@ 2012-09-28 21:05 ` andros
2012-10-01 22:15 ` Myklebust, Trond
0 siblings, 1 reply; 4+ messages in thread
From: andros @ 2012-09-28 21:05 UTC (permalink / raw)
To: trond.myklebust; +Cc: linux-nfs, Andy Adamson
From: Andy Adamson <andros@netapp.com>
We should always reclaim state when the lease and therefore the clientid
is expired.
Signed-off-by: Andy Adamson <andros@netapp.com>
---
fs/nfs/nfs4state.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index a5331ec..134323a 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1600,8 +1600,8 @@ out:
return nfs4_recovery_handle_error(clp, status);
}
-/* Set NFS4CLNT_LEASE_EXPIRED for all v4.0 errors and for recoverable errors
- * on EXCHANGE_ID for v4.1
+/* Set NFS4CLNT_LEASE_EXPIRED and reclaim reboot state for all v4.0 errors
+ * and for recoverable errors on EXCHANGE_ID for v4.1
*/
static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
{
@@ -1647,6 +1647,8 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
return status;
}
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
+ nfs4_state_clear_reclaim_reboot(clp);
+ nfs4_state_start_reclaim_reboot(clp);
dprintk("%s: handled error %d for server %s\n", __func__, status,
clp->cl_hostname);
return 0;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] NFSv4.0 reclaim reboot state when re-establishing clientid
2012-09-28 21:05 ` [PATCH 1/1] " andros
@ 2012-10-01 22:15 ` Myklebust, Trond
2012-10-01 23:12 ` Andy Adamson
0 siblings, 1 reply; 4+ messages in thread
From: Myklebust, Trond @ 2012-10-01 22:15 UTC (permalink / raw)
To: Adamson, Andy; +Cc: linux-nfs@vger.kernel.org
T24gRnJpLCAyMDEyLTA5LTI4IGF0IDE3OjA1IC0wNDAwLCBhbmRyb3NAbmV0YXBwLmNvbSB3cm90
ZToNCj4gRnJvbTogQW5keSBBZGFtc29uIDxhbmRyb3NAbmV0YXBwLmNvbT4NCj4gDQo+IFdlIHNo
b3VsZCBhbHdheXMgcmVjbGFpbSBzdGF0ZSB3aGVuIHRoZSBsZWFzZSBhbmQgdGhlcmVmb3JlIHRo
ZSBjbGllbnRpZA0KPiBpcyBleHBpcmVkLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogQW5keSBBZGFt
c29uIDxhbmRyb3NAbmV0YXBwLmNvbT4NCj4gLS0tDQo+ICBmcy9uZnMvbmZzNHN0YXRlLmMgfCAg
ICA2ICsrKystLQ0KPiAgMSBmaWxlcyBjaGFuZ2VkLCA0IGluc2VydGlvbnMoKyksIDIgZGVs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C0+Y2xfc3RhdGUpOw0KPiArCW5mczRfc3RhdGVf
Y2xlYXJfcmVjbGFpbV9yZWJvb3QoY2xwKTsNCj4gKwluZnM0X3N0YXRlX3N0YXJ0X3JlY2xhaW1f
cmVib290KGNscCk7DQoNClRoaXMgaXMgcHJvYmFibHkgY29ycmVjdCBmb3IgTkZTNEVSUl9TVEFM
RV9DTElFTlRJRCwgYnV0IGNlcnRhaW5seSBub3QNCmZvciBORlM0RVJSX1NFUV9NSVNPUkRFUkVE
LCBvciBORlM0RVJSX0RFTEFZLi4uDQoNCj4gIAlkcHJpbnRrKCIlczogaGFuZGxlZCBlcnJvciAl
ZCBmb3Igc2VydmVyICVzXG4iLCBfX2Z1bmNfXywgc3RhdHVzLA0KPiAgCQkJY2xwLT5jbF9ob3N0
bmFtZSk7DQo+ICAJcmV0dXJuIDA7DQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMg
Y2xpZW50IG1haW50YWluZXINCg0KTmV0QXBwDQpUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbQ0K
d3d3Lm5ldGFwcC5jb20NCg==
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] NFSv4.0 reclaim reboot state when re-establishing clientid
2012-10-01 22:15 ` Myklebust, Trond
@ 2012-10-01 23:12 ` Andy Adamson
0 siblings, 0 replies; 4+ messages in thread
From: Andy Adamson @ 2012-10-01 23:12 UTC (permalink / raw)
To: Myklebust, Trond; +Cc: Adamson, Andy, linux-nfs@vger.kernel.org
On Mon, Oct 1, 2012 at 6:15 PM, Myklebust, Trond
<Trond.Myklebust@netapp.com> wrote:
> On Fri, 2012-09-28 at 17:05 -0400, andros@netapp.com wrote:
>> From: Andy Adamson <andros@netapp.com>
>>
>> We should always reclaim state when the lease and therefore the clientid
>> is expired.
>>
>> Signed-off-by: Andy Adamson <andros@netapp.com>
>> ---
>> fs/nfs/nfs4state.c | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
>> index a5331ec..134323a 100644
>> --- a/fs/nfs/nfs4state.c
>> +++ b/fs/nfs/nfs4state.c
>> @@ -1600,8 +1600,8 @@ out:
>> return nfs4_recovery_handle_error(clp, status);
>> }
>>
>> -/* Set NFS4CLNT_LEASE_EXPIRED for all v4.0 errors and for recoverable errors
>> - * on EXCHANGE_ID for v4.1
>> +/* Set NFS4CLNT_LEASE_EXPIRED and reclaim reboot state for all v4.0 errors
>> + * and for recoverable errors on EXCHANGE_ID for v4.1
>> */
>> static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
>> {
>> @@ -1647,6 +1647,8 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
>> return status;
>> }
>> set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
>> + nfs4_state_clear_reclaim_reboot(clp);
>> + nfs4_state_start_reclaim_reboot(clp);
>
> This is probably correct for NFS4ERR_STALE_CLIENTID, but certainly not
> for NFS4ERR_SEQ_MISORDERED, or NFS4ERR_DELAY...
>
Oops - will resend with fix...
-->Andy
>> dprintk("%s: handled error %d for server %s\n", __func__, status,
>> clp->cl_hostname);
>> return 0;
>
> --
> Trond Myklebust
> Linux NFS client maintainer
>
> NetApp
> Trond.Myklebust@netapp.com
> www.netapp.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-01 23:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 21:05 [PATCH 0/1] NFSv4.0 reclaim reboot state when re-establishing clientid andros
2012-09-28 21:05 ` [PATCH 1/1] " andros
2012-10-01 22:15 ` Myklebust, Trond
2012-10-01 23:12 ` Andy Adamson
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).