staging/lustre/mdc: Handle empty but non-zero acl xattr
staging/lustre/mdc: Handle empty but non-zero acl xattr

We have found that posix_acl_access can have a value
of \002\000\000\000.  In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.

In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL.  Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL.  Passing NULL to posix_acl_valid()
crashes the kernel.

We add a check to properly handle the NULL return value.

Signed-off-by: Christopher J. Morrone <1d83e6ac2379b06e55cc672db2fbfd7afcad693f@llnl.gov>
Reviewed-on: http://review.whamcloud.com/11989
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5150
Reviewed-by: Fan Yong <ab453e5c5a64c8df72d3573911da2af406d0c762@intel.com>
Reviewed-by: Bob Glossman <67e548fbeaf191ffde66fc5ef46cd49dbf7d7d6a@intel.com>
Signed-off-by: Oleg Drokin <65b2ca07820e940f66d8901813c729ec10a548f5@intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs