smb: client: report correct st_size for SMB and NFS symlinks
authorPaulo Alcantara <pc@manguebit.com>
Tue, 28 Nov 2023 19:37:19 +0000 (16:37 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:15 +0000 (08:52 +0100)
commit1de3dbd9a0213a946151bac7017812822bd4b7ca
tree3c86c622e4bb52581bf47d11d867c60fad3c8837
parentb6abe3380977e054a25f6fac82db2b0f18d3dc94
smb: client: report correct st_size for SMB and NFS symlinks

commit 9d63509547a940225d06d7eba1dc412befae255d upstream.

We can't rely on FILE_STANDARD_INFORMATION::EndOfFile for reparse
points as they will be always zero.  Set it to symlink target's length
as specified by POSIX.

This will make stat() family of syscalls return the correct st_size
for such files.

Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/inode.c