linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@kotori.zaitcev.us>
To: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>
Subject: [patch] Allow user.* xattr in tmpfs
Date: Thu, 30 Jun 2016 22:36:08 -0600	[thread overview]
Message-ID: <20160630223608.6ecbec55@lembas.zaitcev.lan> (raw)

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>

             reply	other threads:[~2016-07-01  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  4:36 Pete Zaitcev [this message]
2016-07-05  0:11 ` Hugh Dickins
2016-07-05  2:08   ` Pete Zaitcev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160630223608.6ecbec55@lembas.zaitcev.lan \
    --to=zaitcev@kotori.zaitcev.us \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox