From: Jeff Layton Date: Thu, 23 Feb 2012 14:37:45 +0000 (-0500) Subject: cifs: fix dentry refcount leak when opening a FIFO on lookup X-Git-Tag: v3.3-rc7~24^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bccda0ebc7c0331b81ac47d39e4b920b198b2cd;p=pandora-kernel.git cifs: fix dentry refcount leak when opening a FIFO on lookup The cifs code will attempt to open files on lookup under certain circumstances. What happens though if we find that the file we opened was actually a FIFO or other special file? Currently, the open filehandle just ends up being leaked leading to a dentry refcount mismatch and oops on umount. Fix this by having the code close the filehandle on the server if it turns out not to be a regular file. While we're at it, change this spaghetti if statement into a switch too. Cc: stable@vger.kernel.org Reported-by: CAI Qian Tested-by: CAI Qian Reviewed-by: Shirish Pargaonkar Signed-off-by: Jeff Layton Signed-off-by: Steve French --- Reading git-diff-tree failed