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)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 1 Feb 2016 15:39:24 +0000 (10:39 -0500)
commit3c0a63d74b4a12a0a98cd85b195031d8d4b109a6
treecb491fb2d2f98d015aa49ccb6d7fceb9bfce5150
parentc000201d0b514b2324bfdaccb8bf8f63eafec6e8
ovl: use a minimal buffer in ovl_copy_xattr

[ Upstream commit e4ad29fa0d224d05e08b2858e65f112fd8edd4fe ]

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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/overlayfs/copy_up.c