smb3: fix stat when special device file and mounted with modefromsid
authorSteve French <stfrench@microsoft.com>
Wed, 21 Oct 2020 18:12:08 +0000 (13:12 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 21 Oct 2020 22:57:02 +0000 (17:57 -0500)
commit3c3317daef0afa0cd541fc9c1bfd6ce8bbf1129a
tree2548c9abb1ccf38b2be636d816f2ef4a6ca6e961
parentdef6e1dc17816826fac94f6a5ce125fdee3231ae
smb3: fix stat when special device file and mounted with modefromsid

When mounting with modefromsid mount option, it was possible to
get the error on stat of a fifo or char or block device:
        "cannot stat <filename>: Operation not supported"

Special devices can be stored as reparse points by some servers
(e.g. Windows NFS server and when using the SMB3.1.1 POSIX
Extensions) but when the modefromsid mount option is used
the client attempts to get the ACL for the file which requires
opening with OPEN_REPARSE_POINT create option.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
fs/cifs/smb2ops.c