nfs41_validate_delegation_stateid is broken if we supply a stateid with
a non-zero sequence id. Instead of trying to match the sequence id,
the function assumes that we always want to error. While this is
true for a delegation callback, it is not true in general.
Also fix a typo in nfs4_callback_recall.
Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
res = 0;
break;
case -ENOENT:
- if (res != 0)
- res = htonl(NFS4ERR_BAD_STATEID);
+ res = htonl(NFS4ERR_BAD_STATEID);
break;
default:
res = htonl(NFS4ERR_RESOURCE);
if (delegation == NULL)
return 0;
- if (stateid->stateid.seqid != 0)
+ if (stateid->stateid.seqid != 0 &&
+ stateid->stateid.seqid != delegation->stateid.stateid.seqid)
return 0;
- if (memcmp(&delegation->stateid.stateid.other,
- &stateid->stateid.other,
+ if (memcmp(delegation->stateid.stateid.other,
+ stateid->stateid.other,
NFS4_STATEID_OTHER_SIZE))
return 0;
/**
* nfs_async_inode_return_delegation - asynchronously return a delegation
* @inode: inode to process
- * @stateid: state ID information from CB_RECALL arguments
+ * @stateid: state ID information
*
* Returns zero on success, or a negative errno value.
*/