Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1443329 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-07-14 12:00 +0200 |
| Last post | 2016-07-14 14:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ovl: fix link error without POSIX ACL Arnd Bergmann <arnd@arndb.de> - 2016-07-14 12:00 +0200
Re: [PATCH] ovl: fix link error without POSIX ACL Miklos Szeredi <miklos@szeredi.hu> - 2016-07-14 14:20 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-07-14 12:00 +0200 |
| Subject | [PATCH] ovl: fix link error without POSIX ACL |
| Message-ID | <rULB0-81N-7@gated-at.bofh.it> |
The latest fix for ACL on overlayfs introduced a link error:
fs/built-in.o: In function `ovl_posix_acl_xattr_set':
file.c:(.text+0x6b320): undefined reference to `posix_acl_from_xattr'
posix_acl_from_xattr doesn't have a 'static inline' implementation when
CONFIG_FS_POSIX_ACL is disabled, and I could not come up with an obvious
way to do it.
This instead avoids the link error by defining two sets of ACL operations
and letting the compiler drop one of the two at compile time depending
on CONFIG_FS_POSIX_ACL. This avoids all references to the ACL code,
also leading to smaller code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: f9bc66ad93b8 ("ovl: fix POSIX ACL setting")
---
fs/overlayfs/super.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 17f17885a530..9709f32d13d3 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1056,6 +1056,12 @@ static const struct xattr_handler *ovl_xattr_handlers[] = {
NULL
};
+static const struct xattr_handler *ovl_xattr_noacl_handlers[] = {
+ &ovl_own_xattr_handler,
+ &ovl_other_xattr_handler,
+ NULL,
+};
+
static int ovl_fill_super(struct super_block *sb, void *data, int silent)
{
struct path upperpath = { NULL, NULL };
@@ -1268,7 +1274,10 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
sb->s_magic = OVERLAYFS_SUPER_MAGIC;
sb->s_op = &ovl_super_operations;
- sb->s_xattr = ovl_xattr_handlers;
+ if (IS_ENABLED(CONFIG_FS_POSIX_ACL))
+ sb->s_xattr = ovl_xattr_handlers;
+ else
+ sb->s_xattr = ovl_xattr_noacl_handlers;
sb->s_root = root_dentry;
sb->s_fs_info = ufs;
sb->s_flags |= MS_POSIXACL;
--
2.9.0
[toc] | [next] | [standalone]
| From | Miklos Szeredi <miklos@szeredi.hu> |
|---|---|
| Date | 2016-07-14 14:20 +0200 |
| Message-ID | <rUNMu-19G-25@gated-at.bofh.it> |
| In reply to | #1443329 |
On Thu, Jul 14, 2016 at 11:54 AM, Arnd Bergmann <arnd@arndb.de> wrote: > The latest fix for ACL on overlayfs introduced a link error: > > fs/built-in.o: In function `ovl_posix_acl_xattr_set': > file.c:(.text+0x6b320): undefined reference to `posix_acl_from_xattr' > > posix_acl_from_xattr doesn't have a 'static inline' implementation when > CONFIG_FS_POSIX_ACL is disabled, and I could not come up with an obvious > way to do it. > > This instead avoids the link error by defining two sets of ACL operations > and letting the compiler drop one of the two at compile time depending > on CONFIG_FS_POSIX_ACL. This avoids all references to the ACL code, > also leading to smaller code. Thanks, pushed. Miklos
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web