Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.5 commit in: /
Date: Tue, 29 Mar 2016 00:45:51
Message-Id: 1459212755.dfb0a0a1ae8d29fac2ec39450ba0895328e6ffb6.blueness@gentoo
1 commit: dfb0a0a1ae8d29fac2ec39450ba0895328e6ffb6
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 29 00:52:35 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 29 00:52:35 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=dfb0a0a1
7
8 Update 1500_XATTR_USER_PREFIX.patch for the new struct syntax in 4.5 kernels
9
10 1500_XATTR_USER_PREFIX.patch | 43 +++++++++++++++++++++++++++++--------------
11 1 file changed, 29 insertions(+), 14 deletions(-)
12
13 diff --git a/1500_XATTR_USER_PREFIX.patch b/1500_XATTR_USER_PREFIX.patch
14 index cc15cd5..bacd032 100644
15 --- a/1500_XATTR_USER_PREFIX.patch
16 +++ b/1500_XATTR_USER_PREFIX.patch
17 @@ -14,10 +14,10 @@ enabled for tmpfs. Users who do not enable xattrs will not have
18 the XATTR_PAX flags preserved.
19
20 diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h
21 -index e4629b9..6958086 100644
22 +index 1590c49..5eab462 100644
23 --- a/include/uapi/linux/xattr.h
24 +++ b/include/uapi/linux/xattr.h
25 -@@ -63,5 +63,9 @@
26 +@@ -73,5 +73,9 @@
27 #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
28 #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
29
30 @@ -28,27 +28,42 @@ index e4629b9..6958086 100644
31
32 #endif /* _UAPI_LINUX_XATTR_H */
33 diff --git a/mm/shmem.c b/mm/shmem.c
34 -index 1c44af7..f23bb1b 100644
35 +index 440e2a7..c377172 100644
36 --- a/mm/shmem.c
37 +++ b/mm/shmem.c
38 -@@ -2201,6 +2201,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = {
39 - static int shmem_xattr_validate(const char *name)
40 - {
41 - struct { const char *prefix; size_t len; } arr[] = {
42 -+ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN},
43 - { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN },
44 - { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN }
45 - };
46 -@@ -2256,6 +2257,12 @@ static int shmem_setxattr(struct dentry *dentry, const char *name,
47 - if (err)
48 - return err;
49 +@@ -2667,6 +2667,14 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler,
50 + struct shmem_inode_info *info = SHMEM_I(d_inode(dentry));
51
52 + name = xattr_full_name(handler, name);
53 ++
54 + if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
55 + if (strcmp(name, XATTR_NAME_PAX_FLAGS))
56 + return -EOPNOTSUPP;
57 + if (size > 8)
58 + return -EINVAL;
59 + }
60 ++
61 return simple_xattr_set(&info->xattrs, name, value, size, flags);
62 }
63
64 +@@ -2682,6 +2690,12 @@ static const struct xattr_handler shmem_trusted_xattr_handler = {
65 + .set = shmem_xattr_handler_set,
66 + };
67 +
68 ++static const struct xattr_handler shmem_user_xattr_handler = {
69 ++ .prefix = XATTR_USER_PREFIX,
70 ++ .get = shmem_xattr_handler_get,
71 ++ .set = shmem_xattr_handler_set,
72 ++};
73 ++
74 + static const struct xattr_handler *shmem_xattr_handlers[] = {
75 + #ifdef CONFIG_TMPFS_POSIX_ACL
76 + &posix_acl_access_xattr_handler,
77 +@@ -2689,6 +2703,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = {
78 + #endif
79 + &shmem_security_xattr_handler,
80 + &shmem_trusted_xattr_handler,
81 ++ &shmem_user_xattr_handler,
82 + NULL
83 + };
84 +