NFSv4: If a delegated open fails, ensure that we return the delegation Unless of course the open fails due to permission issues. Signed-off-by: Trond Myklebust --- nfs4proc.c | 2 ++ 1 files changed, 2 insertions(+) Index: linux-2.6/fs/nfs/nfs4proc.c =================================================================== --- linux-2.6.orig/fs/nfs/nfs4proc.c +++ linux-2.6/fs/nfs/nfs4proc.c @@ -658,6 +658,8 @@ out_err: } up_read(&nfsi->rwsem); up_read(&clp->cl_sem); + if (err != -EACCES) + nfs_inode_return_delegation(inode); return err; }