Commit 687dec9b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'erofs-for-5.5-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang:
 "Mainly address a regression reported by David recently observed
  together with overlayfs due to the improper return value of
  listxattr() without xattr. Update outdated expressions in document as
  well.

  Summary:

   - Fix improper return value of listxattr() with no xattr

   - Keep up documentation with latest code"

* tag 'erofs-for-5.5-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: update documentation
  erofs: zero out when listxattr is called with no xattr
parents 6674fdb2 ffafde47
...@@ -24,11 +24,11 @@ Here is the main features of EROFS: ...@@ -24,11 +24,11 @@ Here is the main features of EROFS:
- Metadata & data could be mixed by design; - Metadata & data could be mixed by design;
- 2 inode versions for different requirements: - 2 inode versions for different requirements:
v1 v2 compact (v1) extended (v2)
Inode metadata size: 32 bytes 64 bytes Inode metadata size: 32 bytes 64 bytes
Max file size: 4 GB 16 EB (also limited by max. vol size) Max file size: 4 GB 16 EB (also limited by max. vol size)
Max uids/gids: 65536 4294967296 Max uids/gids: 65536 4294967296
File creation time: no yes (64 + 32-bit timestamp) File change time: no yes (64 + 32-bit timestamp)
Max hardlinks: 65536 4294967296 Max hardlinks: 65536 4294967296
Metadata reserved: 4 bytes 14 bytes Metadata reserved: 4 bytes 14 bytes
...@@ -39,7 +39,7 @@ Here is the main features of EROFS: ...@@ -39,7 +39,7 @@ Here is the main features of EROFS:
- Support POSIX.1e ACLs by using xattrs; - Support POSIX.1e ACLs by using xattrs;
- Support transparent file compression as an option: - Support transparent file compression as an option:
LZ4 algorithm with 4 KB fixed-output compression for high performance; LZ4 algorithm with 4 KB fixed-sized output compression for high performance.
The following git tree provides the file system user-space tools under The following git tree provides the file system user-space tools under
development (ex, formatting tool mkfs.erofs): development (ex, formatting tool mkfs.erofs):
...@@ -85,7 +85,7 @@ All data areas should be aligned with the block size, but metadata areas ...@@ -85,7 +85,7 @@ All data areas should be aligned with the block size, but metadata areas
may not. All metadatas can be now observed in two different spaces (views): may not. All metadatas can be now observed in two different spaces (views):
1. Inode metadata space 1. Inode metadata space
Each valid inode should be aligned with an inode slot, which is a fixed Each valid inode should be aligned with an inode slot, which is a fixed
value (32 bytes) and designed to be kept in line with v1 inode size. value (32 bytes) and designed to be kept in line with compact inode size.
Each inode can be directly found with the following formula: Each inode can be directly found with the following formula:
inode offset = meta_blkaddr * block_size + 32 * nid inode offset = meta_blkaddr * block_size + 32 * nid
...@@ -117,10 +117,10 @@ may not. All metadatas can be now observed in two different spaces (views): ...@@ -117,10 +117,10 @@ may not. All metadatas can be now observed in two different spaces (views):
|-> aligned with 4B |-> aligned with 4B
Inode could be 32 or 64 bytes, which can be distinguished from a common Inode could be 32 or 64 bytes, which can be distinguished from a common
field which all inode versions have -- i_advise: field which all inode versions have -- i_format:
__________________ __________________ __________________ __________________
| i_advise | | i_advise | | i_format | | i_format |
|__________________| |__________________| |__________________| |__________________|
| ... | | ... | | ... | | ... |
| | | | | | | |
...@@ -129,12 +129,13 @@ may not. All metadatas can be now observed in two different spaces (views): ...@@ -129,12 +129,13 @@ may not. All metadatas can be now observed in two different spaces (views):
|__________________| 64 bytes |__________________| 64 bytes
Xattrs, extents, data inline are followed by the corresponding inode with Xattrs, extents, data inline are followed by the corresponding inode with
proper alignes, and they could be optional for different data mappings, proper alignment, and they could be optional for different data mappings.
_currently_ there are totally 3 valid data mappings supported: _currently_ total 4 valid data mappings are supported:
1) flat file data without data inline (no extent); 0 flat file data without data inline (no extent);
2) fixed-output size data compression (must have extents); 1 fixed-sized output data compression (with non-compacted indexes);
3) flat file data with tail-end data inline (no extent); 2 flat file data with tail packing data inline (no extent);
3 fixed-sized output data compression (with compacted indexes, v5.3+).
The size of the optional xattrs is indicated by i_xattr_count in inode The size of the optional xattrs is indicated by i_xattr_count in inode
header. Large xattrs or xattrs shared by many different files can be header. Large xattrs or xattrs shared by many different files can be
...@@ -182,8 +183,8 @@ introduce another on-disk field at all. ...@@ -182,8 +183,8 @@ introduce another on-disk field at all.
Compression Compression
----------- -----------
Currently, EROFS supports 4KB fixed-output clustersize transparent file Currently, EROFS supports 4KB fixed-sized output transparent file compression,
compression, as illustrated below: as illustrated below:
|---- Variant-Length Extent ----|-------- VLE --------|----- VLE ----- |---- Variant-Length Extent ----|-------- VLE --------|----- VLE -----
clusterofs clusterofs clusterofs clusterofs clusterofs clusterofs
......
...@@ -649,6 +649,8 @@ ssize_t erofs_listxattr(struct dentry *dentry, ...@@ -649,6 +649,8 @@ ssize_t erofs_listxattr(struct dentry *dentry,
struct listxattr_iter it; struct listxattr_iter it;
ret = init_inode_xattrs(d_inode(dentry)); ret = init_inode_xattrs(d_inode(dentry));
if (ret == -ENOATTR)
return 0;
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment