]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf5a5eaa177ed5b035b89b5b82bad1003a80d8321
tree708f90365fd6d08b197801a8a4d7424b3b87831c
parent35cd19c1a5f90bb325e335c0911f0910c921c5a8
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