Merge tag 'erofs-for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Apr 2023 21:25:39 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Apr 2023 21:25:39 +0000 (14:25 -0700)
Pull erofs updates from Gao Xiang:
 "In this cycle, sub-page block support for uncompressed files is
  available. It's mainly used to enable original signing ('golden')
  4k-block images on arm64 with 16/64k pages. In addition, end users
  could also use this feature to build a manifest to directly refer to
  golden tar data.

  Besides, long xattr name prefix support is also introduced in this
  cycle to avoid too many xattrs with the same prefix (e.g. overlayfs
  xattrs). It's useful for erofs + overlayfs combination (like Composefs
  model): the image size is reduced by ~14% and runtime performance is
  also slightly improved.

  Others are random fixes and cleanups as usual.

  Summary:

   - Add sub-page block size support for uncompressed files

   - Support flattened block device for multi-blob images to be attached
     into virtual machines (including cloud servers) and bare metals

   - Support long xattr name prefixes to optimize images with common
     xattr namespaces (e.g. files with overlayfs xattrs) use cases

   - Various minor cleanups & fixes"

* tag 'erofs-for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: cleanup i_format-related stuffs
  erofs: sunset erofs_dbg()
  erofs: fix potential overflow calculating xattr_isize
  erofs: get rid of z_erofs_fill_inode()
  erofs: enable long extended attribute name prefixes
  erofs: handle long xattr name prefixes properly
  erofs: add helpers to load long xattr name prefixes
  erofs: introduce on-disk format for long xattr name prefixes
  erofs: move packed inode out of the compression part
  erofs: keep meta inode into erofs_buf
  erofs: initialize packed inode after root inode is assigned
  erofs: stop parsing non-compact HEAD index if clusterofs is invalid
  erofs: don't warn ztailpacking feature anymore
  erofs: simplify erofs_xattr_generic_get()
  erofs: rename init_inode_xattrs with erofs_ prefix
  erofs: move several xattr helpers into xattr.c
  erofs: tidy up EROFS on-disk naming
  erofs: support flattened block device for multi-blob images
  erofs: set block size to the on-disk block size
  erofs: avoid hardcoded blocksize for subpage block support

1  2 
fs/erofs/xattr.c
fs/erofs/xattr.h

@@@ -483,12 -517,28 +513,25 @@@ static int xattr_entrylist(struct xattr
  {
        struct listxattr_iter *it =
                container_of(_it, struct listxattr_iter, it);
-       unsigned int prefix_len;
-       const char *prefix;
+       unsigned int base_index = entry->e_name_index;
+       unsigned int prefix_len, infix_len = 0;
+       const char *prefix, *infix = NULL;
 -      const struct xattr_handler *h;
+       if (entry->e_name_index & EROFS_XATTR_LONG_PREFIX) {
+               struct erofs_sb_info *sbi = EROFS_SB(_it->sb);
+               struct erofs_xattr_prefix_item *pf = sbi->xattr_prefixes +
+                       (entry->e_name_index & EROFS_XATTR_LONG_PREFIX_MASK);
+               if (pf >= sbi->xattr_prefixes + sbi->xattr_prefix_count)
+                       return 1;
+               infix = pf->prefix->infix;
+               infix_len = pf->infix_len;
+               base_index = pf->prefix->base_index;
+       }
  
-       prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
 -      h = erofs_xattr_handler(base_index);
 -      if (!h || (h->list && !h->list(it->dentry)))
++      prefix = erofs_xattr_prefix(base_index, it->dentry);
 +      if (!prefix)
                return 1;
 -
 -      prefix = xattr_prefix(h);
        prefix_len = strlen(prefix);
  
        if (!it->buffer) {
Simple merge