Merge tag 'fs_for_v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 Apr 2023 16:07:46 +0000 (09:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 Apr 2023 16:07:46 +0000 (09:07 -0700)
Pull ext2, reiserfs, udf, and quota updates from Jan Kara:
 "A couple of small fixes and cleanups for ext2, udf, reiserfs, and
  quota.

  The biggest change is making CONFIG_PRINT_QUOTA_WARNING depend on
  BROKEN with an outlook for removing it completely in an year or so"

* tag 'fs_for_v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: mark PRINT_QUOTA_WARNING as BROKEN
  quota: update Kconfig comment
  reiserfs: remove unused iter variable
  quota: Use register_sysctl_init() for registering fs_dqstats_table
  reiserfs: remove unused sched_count variable
  ext2: remove redundant assignment to pointer end
  quota: make dquot_set_dqinfo return errors from ->write_info
  quota: fixup *_write_file_info() to return proper error code
  quota: simplify two-level sysctl registration for fs_dqstats_table
  udf: use wrapper i_blocksize() in udf_discard_prealloc()
  udf: Use folios in udf_adinicb_writepage()
  ext2: Check block size validity during mount
  ext2: Correct maximum ext2 filesystem block size

1  2 
fs/ext2/xattr.c

diff --combined fs/ext2/xattr.c
index b126af5f8b15211a20f95c44561902d9a29ea2fd,d4015e675c248ed54ef3fe8c7e96e6e064318553..8906ba479aafb513e8758c354e7767c03f784681
@@@ -101,8 -101,8 +101,8 @@@ static void ext2_xattr_rehash(struct ex
  static const struct xattr_handler *ext2_xattr_handler_map[] = {
        [EXT2_XATTR_INDEX_USER]              = &ext2_xattr_user_handler,
  #ifdef CONFIG_EXT2_FS_POSIX_ACL
 -      [EXT2_XATTR_INDEX_POSIX_ACL_ACCESS]  = &posix_acl_access_xattr_handler,
 -      [EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT] = &posix_acl_default_xattr_handler,
 +      [EXT2_XATTR_INDEX_POSIX_ACL_ACCESS]  = &nop_posix_acl_access,
 +      [EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT] = &nop_posix_acl_default,
  #endif
        [EXT2_XATTR_INDEX_TRUSTED]           = &ext2_xattr_trusted_handler,
  #ifdef CONFIG_EXT2_FS_SECURITY
  const struct xattr_handler *ext2_xattr_handlers[] = {
        &ext2_xattr_user_handler,
        &ext2_xattr_trusted_handler,
 -#ifdef CONFIG_EXT2_FS_POSIX_ACL
 -      &posix_acl_access_xattr_handler,
 -      &posix_acl_default_xattr_handler,
 -#endif
  #ifdef CONFIG_EXT2_FS_SECURITY
        &ext2_xattr_security_handler,
  #endif
  
  #define EA_BLOCK_CACHE(inode) (EXT2_SB(inode->i_sb)->s_ea_block_cache)
  
 -static inline const struct xattr_handler *
 -ext2_xattr_handler(int name_index)
 +static inline const char *ext2_xattr_prefix(int name_index,
 +                                          struct dentry *dentry)
  {
        const struct xattr_handler *handler = NULL;
  
        if (name_index > 0 && name_index < ARRAY_SIZE(ext2_xattr_handler_map))
                handler = ext2_xattr_handler_map[name_index];
 -      return handler;
 +
 +      if (!xattr_handler_can_list(handler, dentry))
 +              return NULL;
 +
 +      return xattr_prefix(handler);
  }
  
  static bool
@@@ -333,10 -333,11 +333,10 @@@ bad_block
        /* list the attribute names */
        for (entry = FIRST_ENTRY(bh); !IS_LAST_ENTRY(entry);
             entry = EXT2_XATTR_NEXT(entry)) {
 -              const struct xattr_handler *handler =
 -                      ext2_xattr_handler(entry->e_name_index);
 +              const char *prefix;
  
 -              if (handler && (!handler->list || handler->list(dentry))) {
 -                      const char *prefix = handler->prefix ?: handler->name;
 +              prefix = ext2_xattr_prefix(entry->e_name_index, dentry);
 +              if (prefix) {
                        size_t prefix_len = strlen(prefix);
                        size_t size = prefix_len + entry->e_name_len + 1;
  
@@@ -552,7 -553,6 +552,6 @@@ bad_block
                error = -ENOMEM;
                if (header == NULL)
                        goto cleanup;
-               end = (char *)header + sb->s_blocksize;
                header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC);
                header->h_blocks = header->h_refcount = cpu_to_le32(1);
                last = here = ENTRY(header+1);