Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: Remove CONFIG_EXT4_FS_XATTR

Ted has sent out a RFC about removing this feature. Eric and Jan
confirmed that both RedHat and SUSE enable this feature in all their
product. David also said that "As far as I know, it's enabled in all
Android kernels that use ext4." So it seems OK for us.

And what's more, as inline data depends its implementation on xattr,
and to be frank, I don't run any test again inline data enabled while
xattr disabled. So I think we should add inline data and remove this
config option in the same release.

[ The savings if you disable CONFIG_EXT4_FS_XATTR is only 27k, which
isn't much in the grand scheme of things. Since no one seems to be
testing this configuration except for some automated compile farms, on
balance we are better removing this config option, and so that it is
effectively always enabled. -- tytso ]

Cc: David Brown <davidb@codeaurora.org>
Cc: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by

Tao Ma and committed by
Theodore Ts'o
939da108 187fd030

+7 -281
+3 -6
Documentation/filesystems/ext4.txt
··· 200 200 table readahead algorithm will pre-read into 201 201 the buffer cache. The default value is 32 blocks. 202 202 203 - nouser_xattr Disables Extended User Attributes. If you have extended 204 - attribute support enabled in the kernel configuration 205 - (CONFIG_EXT4_FS_XATTR), extended attribute support 206 - is enabled by default on mount. See the attr(5) manual 207 - page and http://acl.bestbits.at/ for more information 208 - about extended attributes. 203 + nouser_xattr Disables Extended User Attributes. See the 204 + attr(5) manual page and http://acl.bestbits.at/ 205 + for more information about extended attributes. 209 206 210 207 noacl This option disables POSIX Access Control List 211 208 support. If ACL support is enabled in the kernel
+2 -2
fs/Kconfig
··· 28 28 tristate 29 29 default y if EXT2_FS=y && EXT2_FS_XATTR 30 30 default y if EXT3_FS=y && EXT3_FS_XATTR 31 - default y if EXT4_FS=y && EXT4_FS_XATTR 32 - default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR 31 + default y if EXT4_FS=y 32 + default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS 33 33 34 34 source "fs/reiserfs/Kconfig" 35 35 source "fs/jfs/Kconfig"
-15
fs/ext4/Kconfig
··· 39 39 compiled kernel size by using one file system driver for 40 40 ext2, ext3, and ext4 file systems. 41 41 42 - config EXT4_FS_XATTR 43 - bool "Ext4 extended attributes" 44 - depends on EXT4_FS 45 - default y 46 - help 47 - Extended attributes are name:value pairs associated with inodes by 48 - the kernel or by users (see the attr(5) manual page, or visit 49 - <http://acl.bestbits.at/> for details). 50 - 51 - If unsure, say N. 52 - 53 - You need this for POSIX ACL support on ext4. 54 - 55 42 config EXT4_FS_POSIX_ACL 56 43 bool "Ext4 POSIX Access Control Lists" 57 - depends on EXT4_FS_XATTR 58 44 select FS_POSIX_ACL 59 45 help 60 46 POSIX Access Control Lists (ACLs) support permissions for users and ··· 53 67 54 68 config EXT4_FS_SECURITY 55 69 bool "Ext4 Security Labels" 56 - depends on EXT4_FS_XATTR 57 70 help 58 71 Security labels support alternative access control models 59 72 implemented by security modules like SELinux. This option
+2 -2
fs/ext4/Makefile
··· 7 7 ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \ 8 8 ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ 9 9 ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o \ 10 - mmp.o indirect.o extents_status.o 10 + mmp.o indirect.o extents_status.o xattr.o xattr_user.o \ 11 + xattr_trusted.o inline.o 11 12 12 - ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o inline.o 13 13 ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o 14 14 ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o
-2
fs/ext4/ext4.h
··· 848 848 #endif 849 849 unsigned long i_flags; 850 850 851 - #ifdef CONFIG_EXT4_FS_XATTR 852 851 /* 853 852 * Extended attributes can be read independently of the main file 854 853 * data. Taking i_mutex even when reading would cause contention ··· 856 857 * EAs. 857 858 */ 858 859 struct rw_semaphore xattr_sem; 859 - #endif 860 860 861 861 struct list_head i_orphan; /* unlinked but open inodes */ 862 862
-2
fs/ext4/file.c
··· 656 656 const struct inode_operations ext4_file_inode_operations = { 657 657 .setattr = ext4_setattr, 658 658 .getattr = ext4_getattr, 659 - #ifdef CONFIG_EXT4_FS_XATTR 660 659 .setxattr = generic_setxattr, 661 660 .getxattr = generic_getxattr, 662 661 .listxattr = ext4_listxattr, 663 662 .removexattr = generic_removexattr, 664 - #endif 665 663 .get_acl = ext4_get_acl, 666 664 .fiemap = ext4_fiemap, 667 665 };
-4
fs/ext4/namei.c
··· 3228 3228 .mknod = ext4_mknod, 3229 3229 .rename = ext4_rename, 3230 3230 .setattr = ext4_setattr, 3231 - #ifdef CONFIG_EXT4_FS_XATTR 3232 3231 .setxattr = generic_setxattr, 3233 3232 .getxattr = generic_getxattr, 3234 3233 .listxattr = ext4_listxattr, 3235 3234 .removexattr = generic_removexattr, 3236 - #endif 3237 3235 .get_acl = ext4_get_acl, 3238 3236 .fiemap = ext4_fiemap, 3239 3237 }; 3240 3238 3241 3239 const struct inode_operations ext4_special_inode_operations = { 3242 3240 .setattr = ext4_setattr, 3243 - #ifdef CONFIG_EXT4_FS_XATTR 3244 3241 .setxattr = generic_setxattr, 3245 3242 .getxattr = generic_getxattr, 3246 3243 .listxattr = ext4_listxattr, 3247 3244 .removexattr = generic_removexattr, 3248 - #endif 3249 3245 .get_acl = ext4_get_acl, 3250 3246 };
-9
fs/ext4/super.c
··· 997 997 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; 998 998 999 999 INIT_LIST_HEAD(&ei->i_orphan); 1000 - #ifdef CONFIG_EXT4_FS_XATTR 1001 1000 init_rwsem(&ei->xattr_sem); 1002 - #endif 1003 1001 init_rwsem(&ei->i_data_sem); 1004 1002 inode_init_once(&ei->vfs_inode); 1005 1003 } ··· 1447 1449 {Opt_data_journal, EXT4_MOUNT_JOURNAL_DATA, MOPT_DATAJ}, 1448 1450 {Opt_data_ordered, EXT4_MOUNT_ORDERED_DATA, MOPT_DATAJ}, 1449 1451 {Opt_data_writeback, EXT4_MOUNT_WRITEBACK_DATA, MOPT_DATAJ}, 1450 - #ifdef CONFIG_EXT4_FS_XATTR 1451 1452 {Opt_user_xattr, EXT4_MOUNT_XATTR_USER, MOPT_SET}, 1452 1453 {Opt_nouser_xattr, EXT4_MOUNT_XATTR_USER, MOPT_CLEAR}, 1453 - #else 1454 - {Opt_user_xattr, 0, MOPT_NOSUPPORT}, 1455 - {Opt_nouser_xattr, 0, MOPT_NOSUPPORT}, 1456 - #endif 1457 1454 #ifdef CONFIG_EXT4_FS_POSIX_ACL 1458 1455 {Opt_acl, EXT4_MOUNT_POSIX_ACL, MOPT_SET}, 1459 1456 {Opt_noacl, EXT4_MOUNT_POSIX_ACL, MOPT_CLEAR}, ··· 3361 3368 if (def_mount_opts & EXT4_DEFM_UID16) 3362 3369 set_opt(sb, NO_UID32); 3363 3370 /* xattr user namespace & acls are now defaulted on */ 3364 - #ifdef CONFIG_EXT4_FS_XATTR 3365 3371 set_opt(sb, XATTR_USER); 3366 - #endif 3367 3372 #ifdef CONFIG_EXT4_FS_POSIX_ACL 3368 3373 set_opt(sb, POSIX_ACL); 3369 3374 #endif
-4
fs/ext4/symlink.c
··· 35 35 .follow_link = page_follow_link_light, 36 36 .put_link = page_put_link, 37 37 .setattr = ext4_setattr, 38 - #ifdef CONFIG_EXT4_FS_XATTR 39 38 .setxattr = generic_setxattr, 40 39 .getxattr = generic_getxattr, 41 40 .listxattr = ext4_listxattr, 42 41 .removexattr = generic_removexattr, 43 - #endif 44 42 }; 45 43 46 44 const struct inode_operations ext4_fast_symlink_inode_operations = { 47 45 .readlink = generic_readlink, 48 46 .follow_link = ext4_follow_link, 49 47 .setattr = ext4_setattr, 50 - #ifdef CONFIG_EXT4_FS_XATTR 51 48 .setxattr = generic_setxattr, 52 49 .getxattr = generic_getxattr, 53 50 .listxattr = ext4_listxattr, 54 51 .removexattr = generic_removexattr, 55 - #endif 56 52 };
-235
fs/ext4/xattr.h
··· 92 92 struct ext4_iloc iloc; 93 93 }; 94 94 95 - # ifdef CONFIG_EXT4_FS_XATTR 96 - 97 95 extern const struct xattr_handler ext4_xattr_user_handler; 98 96 extern const struct xattr_handler ext4_xattr_trusted_handler; 99 97 extern const struct xattr_handler ext4_xattr_acl_access_handler; ··· 191 193 extern void ext4_inline_data_truncate(struct inode *inode, int *has_inline); 192 194 193 195 extern int ext4_convert_inline_data(struct inode *inode); 194 - # else /* CONFIG_EXT4_FS_XATTR */ 195 - 196 - static inline int 197 - ext4_xattr_get(struct inode *inode, int name_index, const char *name, 198 - void *buffer, size_t size, int flags) 199 - { 200 - return -EOPNOTSUPP; 201 - } 202 - 203 - static inline int 204 - ext4_xattr_set(struct inode *inode, int name_index, const char *name, 205 - const void *value, size_t size, int flags) 206 - { 207 - return -EOPNOTSUPP; 208 - } 209 - 210 - static inline int 211 - ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, 212 - const char *name, const void *value, size_t size, int flags) 213 - { 214 - return -EOPNOTSUPP; 215 - } 216 - 217 - static inline void 218 - ext4_xattr_delete_inode(handle_t *handle, struct inode *inode) 219 - { 220 - } 221 - 222 - static inline void 223 - ext4_xattr_put_super(struct super_block *sb) 224 - { 225 - } 226 - 227 - static __init inline int 228 - ext4_init_xattr(void) 229 - { 230 - return 0; 231 - } 232 - 233 - static inline void 234 - ext4_exit_xattr(void) 235 - { 236 - } 237 - 238 - static inline int 239 - ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, 240 - struct ext4_inode *raw_inode, handle_t *handle) 241 - { 242 - return -EOPNOTSUPP; 243 - } 244 - 245 - #define ext4_xattr_handlers NULL 246 - 247 - static inline int 248 - ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i, 249 - struct ext4_xattr_ibody_find *is) 250 - { 251 - return -EOPNOTSUPP; 252 - } 253 - 254 - static inline int 255 - ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, 256 - struct ext4_xattr_info *i, 257 - struct ext4_xattr_ibody_find *is) 258 - { 259 - return -EOPNOTSUPP; 260 - } 261 - 262 - static inline int 263 - ext4_xattr_ibody_get(struct inode *inode, int name_index, 264 - const char *name, 265 - void *buffer, size_t buffer_size) 266 - { 267 - return -EOPNOTSUPP; 268 - } 269 - 270 - static inline int ext4_find_inline_data_nolock(struct inode *inode) 271 - { 272 - return 0; 273 - } 274 - 275 - static inline int ext4_has_inline_data(struct inode *inode) 276 - { 277 - return 0; 278 - } 279 - 280 - static inline int ext4_get_inline_size(struct inode *inode) 281 - { 282 - return 0; 283 - } 284 - 285 - static inline int ext4_get_max_inline_size(struct inode *inode) 286 - { 287 - return 0; 288 - } 289 - 290 - static inline void ext4_write_inline_data(struct inode *inode, 291 - struct ext4_iloc *iloc, 292 - void *buffer, loff_t pos, 293 - unsigned int len) 294 - { 295 - return; 296 - } 297 - 298 - static inline int ext4_init_inline_data(handle_t *handle, 299 - struct inode *inode, 300 - unsigned int len) 301 - { 302 - return 0; 303 - } 304 - 305 - static inline int ext4_destroy_inline_data(handle_t *handle, 306 - struct inode *inode) 307 - { 308 - return 0; 309 - } 310 - 311 - static inline int ext4_readpage_inline(struct inode *inode, struct page *page) 312 - { 313 - return 0; 314 - } 315 - 316 - static inline int ext4_try_to_write_inline_data(struct address_space *mapping, 317 - struct inode *inode, 318 - loff_t pos, unsigned len, 319 - unsigned flags, 320 - struct page **pagep) 321 - { 322 - return 0; 323 - } 324 - 325 - static inline int ext4_write_inline_data_end(struct inode *inode, 326 - loff_t pos, unsigned len, 327 - unsigned copied, 328 - struct page *page) 329 - { 330 - return 0; 331 - } 332 - 333 - static inline struct buffer_head * 334 - ext4_journalled_write_inline_data(struct inode *inode, 335 - unsigned len, 336 - struct page *page) 337 - { 338 - return NULL; 339 - } 340 - 341 - static inline int 342 - ext4_da_write_inline_data_begin(struct address_space *mapping, 343 - struct inode *inode, 344 - loff_t pos, unsigned len, 345 - unsigned flags, 346 - struct page **pagep, 347 - void **fsdata) 348 - { 349 - return 0; 350 - } 351 - 352 - static inline int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, 353 - unsigned len, unsigned copied, 354 - struct page *page) 355 - { 356 - return 0; 357 - } 358 - 359 - static inline int ext4_try_add_inline_entry(handle_t *handle, 360 - struct dentry *dentry, 361 - struct inode *inode) 362 - { 363 - return 0; 364 - } 365 - 366 - static inline int ext4_try_create_inline_dir(handle_t *handle, 367 - struct inode *parent, 368 - struct inode *inode) 369 - { 370 - return 0; 371 - } 372 - static inline int ext4_read_inline_dir(struct file *filp, 373 - void *dirent, filldir_t filldir, 374 - int *has_inline_data) 375 - { 376 - return 0; 377 - } 378 - 379 - static inline struct buffer_head * 380 - ext4_find_inline_entry(struct inode *dir, 381 - const struct qstr *d_name, 382 - struct ext4_dir_entry_2 **res_dir, 383 - int *has_inline_data) 384 - { 385 - return NULL; 386 - } 387 - static inline int ext4_delete_inline_entry(handle_t *handle, 388 - struct inode *dir, 389 - struct ext4_dir_entry_2 *de_del, 390 - struct buffer_head *bh, 391 - int *has_inline_data) 392 - { 393 - return 0; 394 - } 395 - 396 - static inline int empty_inline_dir(struct inode *dir, int *has_inline_data) 397 - { 398 - return 0; 399 - } 400 - 401 - static inline struct buffer_head * 402 - ext4_get_first_inline_block(struct inode *inode, 403 - struct ext4_dir_entry_2 **parent_de, 404 - int *retval) 405 - { 406 - return NULL; 407 - } 408 - 409 - static inline int ext4_inline_data_fiemap(struct inode *inode, 410 - struct fiemap_extent_info *fieinfo, 411 - int *has_inline) 412 - { 413 - return 0; 414 - } 415 - 416 - static inline void ext4_inline_data_truncate(struct inode *inode, 417 - int *has_inline) 418 - { 419 - return; 420 - } 421 - 422 - static inline int ext4_convert_inline_data(struct inode *inode) 423 - { 424 - return 0; 425 - } 426 - # endif /* CONFIG_EXT4_FS_XATTR */ 427 196 428 197 #ifdef CONFIG_EXT4_FS_SECURITY 429 198 extern int ext4_init_security(handle_t *handle, struct inode *inode,