aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2018-07-31 09:13:20 -0400
committerRichard Weinberger <richard@nod.at>2018-08-14 18:25:14 -0400
commit7e5471ce6dba5f28a3c7afdfe168655d236f677b (patch)
treed98f6ecb5637c38eda5f6a961cc15d9d780793b4
parent1bf0572fe27030a0e82fc60f8323a2114c2b69d3 (diff)
ubifs: introduce Kconfig symbol for xattr support
Allow to disable extended attribute support. This aids in reliability testing, especially since some xattr related bugs have surfaced. Also an embedded system might not need it, so this allows for a slightly smaller kernel (about 4KiB). Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/Kconfig15
-rw-r--r--fs/ubifs/Makefile3
-rw-r--r--fs/ubifs/dir.c2
-rw-r--r--fs/ubifs/file.c4
-rw-r--r--fs/ubifs/super.c2
-rw-r--r--fs/ubifs/ubifs.h6
6 files changed, 29 insertions, 3 deletions
diff --git a/fs/ubifs/Kconfig b/fs/ubifs/Kconfig
index 83a961bf7280..bbc78549be4c 100644
--- a/fs/ubifs/Kconfig
+++ b/fs/ubifs/Kconfig
@@ -51,9 +51,20 @@ config UBIFS_ATIME_SUPPORT
51 51
52 If unsure, say 'N' 52 If unsure, say 'N'
53 53
54config UBIFS_FS_XATTR
55 bool "UBIFS XATTR support"
56 depends on UBIFS_FS
57 default y
58 help
59 Saying Y here includes support for extended attributes (xattrs).
60 Xattrs are name:value pairs associated with inodes by
61 the kernel or by users (see the attr(5) manual page).
62
63 If unsure, say Y.
64
54config UBIFS_FS_ENCRYPTION 65config UBIFS_FS_ENCRYPTION
55 bool "UBIFS Encryption" 66 bool "UBIFS Encryption"
56 depends on UBIFS_FS && BLOCK 67 depends on UBIFS_FS && UBIFS_FS_XATTR && BLOCK
57 select FS_ENCRYPTION 68 select FS_ENCRYPTION
58 default n 69 default n
59 help 70 help
@@ -64,7 +75,7 @@ config UBIFS_FS_ENCRYPTION
64 75
65config UBIFS_FS_SECURITY 76config UBIFS_FS_SECURITY
66 bool "UBIFS Security Labels" 77 bool "UBIFS Security Labels"
67 depends on UBIFS_FS 78 depends on UBIFS_FS && UBIFS_FS_XATTR
68 default y 79 default y
69 help 80 help
70 Security labels provide an access control facility to support Linux 81 Security labels provide an access control facility to support Linux
diff --git a/fs/ubifs/Makefile b/fs/ubifs/Makefile
index 9758f709c736..6197d7e539e4 100644
--- a/fs/ubifs/Makefile
+++ b/fs/ubifs/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_UBIFS_FS) += ubifs.o
4ubifs-y += shrinker.o journal.o file.o dir.o super.o sb.o io.o 4ubifs-y += shrinker.o journal.o file.o dir.o super.o sb.o io.o
5ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o 5ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o
6ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o 6ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o
7ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o debug.o 7ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o debug.o
8ubifs-y += misc.o 8ubifs-y += misc.o
9ubifs-$(CONFIG_UBIFS_FS_ENCRYPTION) += crypto.o 9ubifs-$(CONFIG_UBIFS_FS_ENCRYPTION) += crypto.o
10ubifs-$(CONFIG_UBIFS_FS_XATTR) += xattr.o
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index e8616040bffc..85aea556b709 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -1648,7 +1648,9 @@ const struct inode_operations ubifs_dir_inode_operations = {
1648 .rename = ubifs_rename, 1648 .rename = ubifs_rename,
1649 .setattr = ubifs_setattr, 1649 .setattr = ubifs_setattr,
1650 .getattr = ubifs_getattr, 1650 .getattr = ubifs_getattr,
1651#ifdef CONFIG_UBIFS_FS_XATTR
1651 .listxattr = ubifs_listxattr, 1652 .listxattr = ubifs_listxattr,
1653#endif
1652#ifdef CONFIG_UBIFS_ATIME_SUPPORT 1654#ifdef CONFIG_UBIFS_ATIME_SUPPORT
1653 .update_time = ubifs_update_time, 1655 .update_time = ubifs_update_time,
1654#endif 1656#endif
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 02fab5c322c7..745b3f810fb9 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1653,7 +1653,9 @@ const struct address_space_operations ubifs_file_address_operations = {
1653const struct inode_operations ubifs_file_inode_operations = { 1653const struct inode_operations ubifs_file_inode_operations = {
1654 .setattr = ubifs_setattr, 1654 .setattr = ubifs_setattr,
1655 .getattr = ubifs_getattr, 1655 .getattr = ubifs_getattr,
1656#ifdef CONFIG_UBIFS_FS_XATTR
1656 .listxattr = ubifs_listxattr, 1657 .listxattr = ubifs_listxattr,
1658#endif
1657#ifdef CONFIG_UBIFS_ATIME_SUPPORT 1659#ifdef CONFIG_UBIFS_ATIME_SUPPORT
1658 .update_time = ubifs_update_time, 1660 .update_time = ubifs_update_time,
1659#endif 1661#endif
@@ -1663,7 +1665,9 @@ const struct inode_operations ubifs_symlink_inode_operations = {
1663 .get_link = ubifs_get_link, 1665 .get_link = ubifs_get_link,
1664 .setattr = ubifs_setattr, 1666 .setattr = ubifs_setattr,
1665 .getattr = ubifs_getattr, 1667 .getattr = ubifs_getattr,
1668#ifdef CONFIG_UBIFS_FS_XATTR
1666 .listxattr = ubifs_listxattr, 1669 .listxattr = ubifs_listxattr,
1670#endif
1667#ifdef CONFIG_UBIFS_ATIME_SUPPORT 1671#ifdef CONFIG_UBIFS_ATIME_SUPPORT
1668 .update_time = ubifs_update_time, 1672 .update_time = ubifs_update_time,
1669#endif 1673#endif
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index c5466c70d620..564a131afc56 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2053,7 +2053,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
2053 if (c->max_inode_sz > MAX_LFS_FILESIZE) 2053 if (c->max_inode_sz > MAX_LFS_FILESIZE)
2054 sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; 2054 sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE;
2055 sb->s_op = &ubifs_super_operations; 2055 sb->s_op = &ubifs_super_operations;
2056#ifdef CONFIG_UBIFS_FS_XATTR
2056 sb->s_xattr = ubifs_xattr_handlers; 2057 sb->s_xattr = ubifs_xattr_handlers;
2058#endif
2057#ifdef CONFIG_UBIFS_FS_ENCRYPTION 2059#ifdef CONFIG_UBIFS_FS_ENCRYPTION
2058 sb->s_cop = &ubifs_crypt_operations; 2060 sb->s_cop = &ubifs_crypt_operations;
2059#endif 2061#endif
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 54fb6b1cd042..829308651a5e 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1755,7 +1755,13 @@ int ubifs_xattr_set(struct inode *host, const char *name, const void *value,
1755 size_t size, int flags, bool check_lock); 1755 size_t size, int flags, bool check_lock);
1756ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf, 1756ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf,
1757 size_t size); 1757 size_t size);
1758
1759#ifdef CONFIG_UBIFS_FS_XATTR
1758void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum); 1760void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum);
1761#else
1762static inline void ubifs_evict_xattr_inode(struct ubifs_info *c,
1763 ino_t xattr_inum) { }
1764#endif
1759 1765
1760#ifdef CONFIG_UBIFS_FS_SECURITY 1766#ifdef CONFIG_UBIFS_FS_SECURITY
1761extern int ubifs_init_security(struct inode *dentry, struct inode *inode, 1767extern int ubifs_init_security(struct inode *dentry, struct inode *inode,