cifs: cope with negative dentries in cifs_get_root
commitcae28d950cc7319a7e88deccbb0c4492f0830e6e
authorJeff Layton <jlayton@redhat.com>
Fri, 5 Aug 2011 13:02:40 +0000 (5 09:02 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Aug 2011 01:31:36 +0000 (15 18:31 -0700)
tree603d7c619e4d7c61b8cffbc7df5bc34f812f4f5d
parent6fd70fafa11fd88d5beee360395f4c0b28d7af43
cifs: cope with negative dentries in cifs_get_root

commit 80975d21aae2136ccae1ce914a1602dc1d8b0795 upstream.

The loop around lookup_one_len doesn't handle the case where it might
return a negative dentry, which can cause an oops on the next pass
through the loop. Check for that and break out of the loop with an
error of -ENOENT if there is one.

Fixes the panic reported here:

    https://bugzilla.redhat.com/show_bug.cgi?id=727927

Reported-by: TR Bentley <home@trarbentley.net>
Reported-by: Iain Arnell <iarnell@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifsfs.c