(OK) shmem: enable user xattr for tmpfs

====================================================

shmem: enable user xattr for tmpfs

Forward port the commit 0b98841 of Michael Müller to kernel 4.8.
This is necessary for android-x86 live mode.
====================================================

因此,编译生成 ISO 后,安装 到 VirtualBox 中,然后 debug。不要运行【Live CD】模式。否则,

运行【Live CD】模式,会出现 xattr 相关的错误,导致:

--------------------------------------------------------------------
03-21 22:07:39.035  1636  1672 W PackageManager: Destroying user 0 on volume null because we failed to prepare: java.io.IOException: getxattr failed: ENOTSUP (Operation not supported on transport endpoint)

03-21 22:07:39.047  1636  1672 W PackageManager: Destroying user 0 on volume null because we failed to prepare: java.io.IOException: getxattr failed: ENOTSUP (Operation not supported on transport endpoint)
--------------------------------------------------------------------

--------------------------------------------------------------------
03-21 20:33:03.216  1582  1582 W PackageManager: Destroying user directory /data/user_de/0 because we failed to enforce serial number: java.io.IOException: getxattr failed: ENOTSUP (Operation not supported on transport endpoint)
--------------------------------------------------------------------


====================================================


https://github.com/maurossi/linux/commit/004fa84ccce9ca35efb17085623b896929659889


mm/shmem.c

 	return simple_xattr_set(&info->xattrs, name, value, size, flags);
 }
 
+static const struct xattr_handler shmem_user_xattr_handler = {
+	.prefix = XATTR_USER_PREFIX,
+	.get = shmem_xattr_handler_get,
+	.set = shmem_xattr_handler_set,
+};
+
 static const struct xattr_handler shmem_security_xattr_handler = {
 	.prefix = XATTR_SECURITY_PREFIX,
 	.get = shmem_xattr_handler_get,
@@ -3337,6 +3343,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = {
 	&posix_acl_access_xattr_handler,
 	&posix_acl_default_xattr_handler,
 #endif
+	&shmem_user_xattr_handler,
 	&shmem_security_xattr_handler,
 	&shmem_trusted_xattr_handler,
 	NULL



原文地址:https://www.cnblogs.com/ztguang/p/12644895.html