linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] Allow user.* xattr in tmpfs
@ 2016-07-01  4:36 Pete Zaitcev
  2016-07-05  0:11 ` Hugh Dickins
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Zaitcev @ 2016-07-01  4:36 UTC (permalink / raw)
  To: linux-mm, Hugh Dickins

The lack of user extended attributes is a source of annoyance when
testing something that uses it, such as OpenStack Swift (including
Hummingbird). We used to "monkey-patch" this in Python, so that
tests can run on development systems, but it became desirable
to store correct attributes and existing stubs became impractical.

See:
- my failed attempt to use /var/tmp:
 https://review.openstack.org/328508
- Sam Merritt removing monkey-patching:
 https://review.openstack.org/336323

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
---

This seems entirely too obvious. I'm getting concerned that we omitted
the user xattr for a reason. Just can't imagine what it might be.

diff --git a/mm/shmem.c b/mm/shmem.c
index 24463b6..4ddec69 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2655,6 +2655,12 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler,
 	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,
@@ -2672,6 +2678,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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-05  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-01  4:36 [patch] Allow user.* xattr in tmpfs Pete Zaitcev
2016-07-05  0:11 ` Hugh Dickins
2016-07-05  2:08   ` Pete Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox