X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fnfs%2Fdelegation.c;h=5d8ccecf5f5caada2de94bf30689ecd9e725a15a;hb=53611c0ce9f6e2fa2e31f9ab4ad8c08c512085ba;hp=ef792f29f831c4c72e3e4edd7db9257165aca2fe;hpb=b231070a18d833f425179f2b51c5b22fb6374c7c;p=~andy%2Flinux diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index ef792f29f83..5d8ccecf5f5 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -659,16 +659,19 @@ int nfs_async_inode_return_delegation(struct inode *inode, rcu_read_lock(); delegation = rcu_dereference(NFS_I(inode)->delegation); + if (delegation == NULL) + goto out_enoent; - if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) { - rcu_read_unlock(); - return -ENOENT; - } + if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) + goto out_enoent; nfs_mark_return_delegation(server, delegation); rcu_read_unlock(); nfs_delegation_run_state_manager(clp); return 0; +out_enoent: + rcu_read_unlock(); + return -ENOENT; } static struct inode *