|
@@ -662,18 +662,24 @@ static bool nfs_revoke_delegation(struct inode *inode,
|
|
const nfs4_stateid *stateid)
|
|
const nfs4_stateid *stateid)
|
|
{
|
|
{
|
|
struct nfs_delegation *delegation;
|
|
struct nfs_delegation *delegation;
|
|
|
|
+ nfs4_stateid tmp;
|
|
bool ret = false;
|
|
bool ret = false;
|
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
delegation = rcu_dereference(NFS_I(inode)->delegation);
|
|
delegation = rcu_dereference(NFS_I(inode)->delegation);
|
|
if (delegation == NULL)
|
|
if (delegation == NULL)
|
|
goto out;
|
|
goto out;
|
|
- if (stateid && !nfs4_stateid_match(stateid, &delegation->stateid))
|
|
|
|
|
|
+ if (stateid == NULL) {
|
|
|
|
+ nfs4_stateid_copy(&tmp, &delegation->stateid);
|
|
|
|
+ stateid = &tmp;
|
|
|
|
+ } else if (!nfs4_stateid_match(stateid, &delegation->stateid))
|
|
goto out;
|
|
goto out;
|
|
nfs_mark_delegation_revoked(NFS_SERVER(inode), delegation);
|
|
nfs_mark_delegation_revoked(NFS_SERVER(inode), delegation);
|
|
ret = true;
|
|
ret = true;
|
|
out:
|
|
out:
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
|
|
+ if (ret)
|
|
|
|
+ nfs_inode_find_state_and_recover(inode, stateid);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -685,10 +691,8 @@ void nfs_remove_bad_delegation(struct inode *inode,
|
|
if (!nfs_revoke_delegation(inode, stateid))
|
|
if (!nfs_revoke_delegation(inode, stateid))
|
|
return;
|
|
return;
|
|
delegation = nfs_inode_detach_delegation(inode);
|
|
delegation = nfs_inode_detach_delegation(inode);
|
|
- if (delegation) {
|
|
|
|
- nfs_inode_find_state_and_recover(inode, &delegation->stateid);
|
|
|
|
|
|
+ if (delegation)
|
|
nfs_free_delegation(delegation);
|
|
nfs_free_delegation(delegation);
|
|
- }
|
|
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(nfs_remove_bad_delegation);
|
|
EXPORT_SYMBOL_GPL(nfs_remove_bad_delegation);
|
|
|
|
|