(OK) shmem: enable user xattr for tmpfs - This is necessary for android-x86 live mode.

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

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



posted @   张同光  阅读(217)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示