recovery: use normal OPEN/LOCK on ERR_NO_GRACE

if we see NFS4ERR_NO_GRACE from recovery operations, it means we lost our state due to a lease expiration rather than a server reboot.  in this case, it's possible that conflicting locks were granted to other clients, so we have to try normal OPEN/LOCK operations to recover our state.  because they're sent during recovery, nfs41_open() and nfs41_lock() take a new 'bool_t try_recovery' argument so we can avoid recursion

if these operations fail due to conflicting locks, we have no choice but to return errors to the application.  using a stateid that was revoked due to lease expiration results in NFS4ERR_EXPIRED, and we map this error to ERROR_FILE_INVALID: The volume for a file has been externally altered so that the opened file is no longer valid.

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2010-11-30 13:10:30 -05:00 committed by unknown
parent 222c1bf020
commit 0a309c4350
8 changed files with 46 additions and 17 deletions

View file

@ -316,6 +316,7 @@ int nfs_to_windows_error(int status, int default_error)
case NFS4ERR_SYMLINK:
case NFS4ERR_WRONG_TYPE: return ERROR_INVALID_PARAMETER;
case NFS4ERR_EXPIRED:
case NFS4ERR_NOFILEHANDLE:
case NFS4ERR_OLD_STATEID:
case NFS4ERR_BAD_STATEID: