ovl: use a minimal buffer in ovl_copy_xattr
authorVito Caputo <vito.caputo@coreos.com>
Sat, 24 Oct 2015 12:19:46 +0000 (07:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Feb 2016 20:01:24 +0000 (12:01 -0800)
commitfa932190a5f332e1936ab0223c7c5d79b5596a9c
treeff4218d473333a673e4da6f7f89420e1c8c9b982
parent85a7ed329aca5efd0eb70789db145a1e989c7a53
ovl: use a minimal buffer in ovl_copy_xattr

commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe upstream.

Rather than always allocating the high-order XATTR_SIZE_MAX buffer
which is costly and prone to failure, only allocate what is needed and
realloc if necessary.

Fixes https://github.com/coreos/bugs/issues/489

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/copy_up.c