From: Christoph Hellwig Date: Mon, 30 Jun 2014 15:48:30 +0000 (-0400) Subject: nfsd: fix file access refcount leak when nfsd4_truncate fails X-Git-Tag: omap-for-v3.17/fixes-against-rc2~101^2~147 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e6a72e5f1d42768a9949d73d3337277ff96e026;p=pandora-kernel.git nfsd: fix file access refcount leak when nfsd4_truncate fails nfsd4_process_open2 will currently will get access to the file, and then call nfsd4_truncate to (possibly) truncate it. If that operation fails though, then the access references will never be released as the nfs4_ol_stateid is never initialized. Fix by moving the nfsd4_truncate call into nfs4_get_vfs_file, ensuring that the refcounts are properly put if the truncate fails. Signed-off-by: Jeff Layton Signed-off-by: Christoph Hellwig Signed-off-by: J. Bruce Fields --- Reading git-diff-tree failed