cifs: fix return value for cifs_listxattr
authorRonnie Sahlberg <lsahlber@redhat.com>
Thu, 25 Oct 2018 05:43:36 +0000 (15:43 +1000)
committerSteve French <stfrench@microsoft.com>
Fri, 2 Nov 2018 19:09:41 +0000 (14:09 -0500)
commit0c5d6cb6643f48ad3775322f3ebab6c7eb67484e
tree708f90365fd6d08b197801a8a4d7424b3b87831c
parent5f21585384a4a69b8bfdd2cae7e3648ae805f57d
cifs: fix return value for cifs_listxattr

If the application buffer was too small to fit all the names
we would still count the number of bytes and return this for
listxattr. This would then trigger a BUG in usercopy.c

Fix the computation of the size so that we return -ERANGE
correctly when the buffer is too small.

This fixes the kernel BUG for xfstest generic/377

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
fs/cifs/smb2ops.c