]> git.ipfire.org Git - people/ms/linux.git/commit
nfsd: fix fi_delegees leak when fi_had_conflict returns true
authorJeff Layton <jlayton@primarydata.com>
Sat, 13 Dec 2014 14:11:39 +0000 (09:11 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2015 14:59:53 +0000 (06:59 -0800)
commitbff467fabe9ef86b891bb8968e7f2883c9e46515
tree50453347a6895a49281cdc11ec386f85a785eeab
parent7599f17f0550041e4aa52347654cd9afba3b7acd
nfsd: fix fi_delegees leak when fi_had_conflict returns true

commit 94ae1db226a5bcbb48372d81161f084c9e283fd8 upstream.

Currently, nfs4_set_delegation takes a reference to an existing
delegation and then checks to see if there is a conflict. If there is
one, then it doesn't release that reference.

Change the code to take the reference after the check and only if there
is no conflict.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4state.c