From: Keith Mannthey Date: Mon, 22 Jul 2013 16:07:02 +0000 (+0800) Subject: staging/lustre/llite: error of listxattr when buffer is small X-Git-Tag: v3.12-rc1~183^2~749 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb6a2db640d94a9dc29dabb9bf58d4ff2531d42c;p=pandora-kernel.git staging/lustre/llite: error of listxattr when buffer is small According to the standard, listxattr(2) should return -1 and errno should be set to ERANGE if the size of the list buffer is too small to hold the result. However ll_listxattr() will return a value bigger than the size of buffer in some cases. Let's assume listxattr(2) returns SIZE when it is called with a large enough list buffer. If it's called again with a list buffer whose size is smaller than SIZE but bigger than (SIZE - 12), then listxattr(2) will return SIZE too. This patch fixes the problem. Original patch by Li Xi Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3403 Lustre-change: http://review.whamcloud.com/6463 Signed-off-by: Keith Mannthey Reviewed-by: Li Xi Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed