]> git.karo-electronics.de Git - linux-beck.git/commit
nfsd4: fix file leak on open_downgrade
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 29 Jun 2011 12:23:50 +0000 (08:23 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 15 Jul 2011 22:58:49 +0000 (18:58 -0400)
commitf197c27196a5e7631b89e2e92daa096fcf7c302c
tree1f5b3678d323f439d9660187579775c5f01d813f
parent499f3edc23ca0431f3a0a6736b3a40944c81bf3b
nfsd4: fix file leak on open_downgrade

Stateid's hold a read reference for a read open, a write reference for a
write open, and an additional one of each for each read+write open.  The
latter wasn't getting put on a downgrade, so something like:

open RW
open R
downgrade to R

was resulting in a file leak.

Also fix an imbalance in an error path.

Regression from 7d94784293096c0a46897acdb83be5abd9278ece "nfsd4: fix
downgrade/lock logic".

Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c