nfsd: make sure to balance get/put_write_access
authorChristoph Hellwig <hch@infradead.org>
Mon, 18 Nov 2013 13:07:47 +0000 (05:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:28:04 +0000 (11:28 -0800)
commit479484f703bf1defc7ba73d7a5f37fc330e38c51
tree416b066a5263ce7422b0a5dbd41606fb219ee5c8
parentfc2d834aab8bd8b318aeb3c0e2842c49a7755f0d
nfsd: make sure to balance get/put_write_access

commit 987da4791052fa298b7cfcde4dea9f6f2bbc786b upstream.

Use a straight goto error label style in nfsd_setattr to make sure
we always do the put_write_access call after we got it earlier.

Note that the we have been failing to do that in the case
nfsd_break_lease() returns an error, a bug introduced into 2.6.38 with
6a76bebefe15d9a08864f824d7f8d5beaf37c997 "nfsd4: break lease on nfsd
setattr".

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/vfs.c