smb3: Fix root directory when server returns inode number of zero
authorSteve French <stfrench@microsoft.com>
Sat, 31 Mar 2018 23:13:38 +0000 (18:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:26 +0000 (09:36 +0200)
commit70dbed63a96d1f5ebc779c87f00340d352b3b0c5
treea3a2d239aa2ae0948f89b7ad4528e9501acace21
parentbf895b2a637dc4bbe818cabf1fa2c91a2f346dfd
smb3: Fix root directory when server returns inode number of zero

commit 7ea884c77e5c97f1e0a1a422d961d27f78ca2745 upstream.

Some servers return inode number zero for the root directory, which
causes ls to display incorrect data (missing "." and "..").

If the server returns zero for the inode number of the root directory,
fake an inode number for it.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifsglob.h
fs/cifs/inode.c