From 284c273999ba3f63faf72eb191fe9251d6fc0b2f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 3 Aug 2011 11:40:24 -0400 Subject: [PATCH] recovery: fix for nfs41_delegation_to_open() emc server uses STALE_STATEID error after server reboot, while linux server uses BAD_STATEID Signed-off-by: Casey Bodley --- daemon/delegation.c | 3 ++- daemon/recovery.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/delegation.c b/daemon/delegation.c index c6e39bf..6d436b6 100644 --- a/daemon/delegation.c +++ b/daemon/delegation.c @@ -448,7 +448,8 @@ int nfs41_delegation_to_open( /* save the new open stateid */ memcpy(&open->stateid, &open_stateid, sizeof(stateid4)); open->do_close = 1; - } else if (status == NFS4ERR_BAD_STATEID && open->do_close) { + } else if (open->do_close && (status == NFS4ERR_BAD_STATEID || + status == NFS4ERR_STALE_STATEID || status == NFS4ERR_EXPIRED)) { /* something triggered client state recovery, and the open stateid * has already been reclaimed; see recover_stateid_delegation() */ status = NFS4_OK; diff --git a/daemon/recovery.c b/daemon/recovery.c index ee4ede2..ff994e1 100644 --- a/daemon/recovery.c +++ b/daemon/recovery.c @@ -521,7 +521,7 @@ static bool_t recover_stateid_delegation( AcquireSRWLockShared(&stateid->open->lock); if (argop->op == OP_OPEN && stateid->open->do_close) { /* for nfs41_delegation_to_open(); if we've already reclaimed - * an open stateid, just fail this OPEN with BAD_STATEID */ + * an open stateid, just fail this OPEN with BAD_STATEID */ } else if (stateid->open->delegation.state) { nfs41_delegation_state *deleg = stateid->open->delegation.state; stateid4 *source = &deleg->state.stateid;