Skip to content

Commit

Permalink
Merge tag 'erofs-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/xiang/erofs

Pull more erofs updates from Gao Xiang:
 "This is a follow-up to the main updates, including some fixes of
  fscache mode related to compressed inodes and a cachefiles tracepoint.
  There is also a patch to fix an unexpected decompression strategy
  change due to a cleanup in the past. All the fixes are quite small.

  Apart from these, documentation is also updated for a better
  description of recent new features.

  In addition, this has some trivial cleanups without actual code logic
  changes, so I could have a more recent codebase to work on folios and
  avoiding the PG_error page flag for the next cycle.

  Summary:

   - Leave compressed inodes unsupported in fscache mode for now

   - Avoid crash when using tracepoint cachefiles_prep_read

   - Fix `backmost' behavior due to a recent cleanup

   - Update documentation for better description of recent new features

   - Several decompression cleanups w/o logical change"

* tag 'erofs-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: fix 'backmost' member of z_erofs_decompress_frontend
  erofs: simplify z_erofs_pcluster_readmore()
  erofs: get rid of label `restart_now'
  erofs: get rid of `struct z_erofs_collection'
  erofs: update documentation
  erofs: fix crash when enable tracepoint cachefiles_prep_read
  erofs: leave compressed inodes unsupported in fscache mode for now
  • Loading branch information
Linus Torvalds committed Jun 1, 2022
2 parents e5b0208 + 4398d3c commit 8171acb
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 151 deletions.
64 changes: 42 additions & 22 deletions Documentation/filesystems/erofs.rst
Original file line number Diff line number Diff line change
@@ -1,63 +1,82 @@
.. SPDX-License-Identifier: GPL-2.0
======================================
Enhanced Read-Only File System - EROFS
EROFS - Enhanced Read-Only File System
======================================

Overview
========

EROFS file-system stands for Enhanced Read-Only File System. Different
from other read-only file systems, it aims to be designed for flexibility,
scalability, but be kept simple and high performance.
EROFS filesystem stands for Enhanced Read-Only File System. It aims to form a
generic read-only filesystem solution for various read-only use cases instead
of just focusing on storage space saving without considering any side effects
of runtime performance.

It is designed as a better filesystem solution for the following scenarios:
It is designed to meet the needs of flexibility, feature extendability and user
payload friendly, etc. Apart from those, it is still kept as a simple
random-access friendly high-performance filesystem to get rid of unneeded I/O
amplification and memory-resident overhead compared to similar approaches.

It is implemented to be a better choice for the following scenarios:

- read-only storage media or

- part of a fully trusted read-only solution, which means it needs to be
immutable and bit-for-bit identical to the official golden image for
their releases due to security and other considerations and
their releases due to security or other considerations and

- hope to minimize extra storage space with guaranteed end-to-end performance
by using compact layout, transparent file compression and direct access,
especially for those embedded devices with limited memory and high-density
hosts with numerous containers;
hosts with numerous containers.

Here is the main features of EROFS:

- Little endian on-disk design;

- Currently 4KB block size (nobh) and therefore maximum 16TB address space;

- Metadata & data could be mixed by design;
- 4KiB block size and 32-bit block addresses, therefore 16TiB address space
at most for now;

- 2 inode versions for different requirements:
- Two inode layouts for different requirements:

===================== ============ =====================================
===================== ============ ======================================
compact (v1) extended (v2)
===================== ============ =====================================
===================== ============ ======================================
Inode metadata size 32 bytes 64 bytes
Max file size 4 GB 16 EB (also limited by max. vol size)
Max file size 4 GiB 16 EiB (also limited by max. vol size)
Max uids/gids 65536 4294967296
Per-inode timestamp no yes (64 + 32-bit timestamp)
Max hardlinks 65536 4294967296
Metadata reserved 4 bytes 14 bytes
===================== ============ =====================================
Metadata reserved 8 bytes 18 bytes
===================== ============ ======================================

- Metadata and data could be mixed as an option;

- Support extended attributes (xattrs) as an option;

- Support xattr inline and tail-end data inline for all files;
- Support tailpacking data and xattr inline compared to byte-addressed
unaligned metadata or smaller block size alternatives;

- Support POSIX.1e ACLs by using xattrs;

- Support transparent data compression as an option:
LZ4 algorithm with the fixed-sized output compression for high performance;
LZ4 and MicroLZMA algorithms can be used on a per-file basis; In addition,
inplace decompression is also supported to avoid bounce compressed buffers
and page cache thrashing.

- Support direct I/O on uncompressed files to avoid double caching for loop
devices;

- Multiple device support for multi-layer container images.
- Support FSDAX on uncompressed images for secure containers and ramdisks in
order to get rid of unnecessary page cache.

- Support multiple devices for multi blob container images;

- Support file-based on-demand loading with the Fscache infrastructure.

The following git tree provides the file system user-space tools under
development (ex, formatting tool mkfs.erofs):
development, such as a formatting tool (mkfs.erofs), an on-disk consistency &
compatibility checking tool (fsck.erofs), and a debugging tool (dump.erofs):

- git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git

Expand Down Expand Up @@ -91,6 +110,7 @@ dax={always,never} Use direct access (no page cache). See
Documentation/filesystems/dax.rst.
dax A legacy option which is an alias for ``dax=always``.
device=%s Specify a path to an extra device to be used together.
fsid=%s Specify a filesystem image ID for Fscache back-end.
=================== =========================================================

Sysfs Entries
Expand Down Expand Up @@ -226,8 +246,8 @@ Note that apart from the offset of the first filename, nameoff0 also indicates
the total number of directory entries in this block since it is no need to
introduce another on-disk field at all.

Chunk-based file
----------------
Chunk-based files
-----------------
In order to support chunk-based data deduplication, a new inode data layout has
been supported since Linux v5.15: Files are split in equal-sized data chunks
with ``extents`` area of the inode metadata indicating how to get the chunk
Expand Down
1 change: 1 addition & 0 deletions fs/erofs/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static struct netfs_io_request *erofs_fscache_alloc_request(struct address_space
rreq->start = start;
rreq->len = len;
rreq->mapping = mapping;
rreq->inode = mapping->host;
INIT_LIST_HEAD(&rreq->subrequests);
refcount_set(&rreq->ref, 1);
return rreq;
Expand Down
5 changes: 4 additions & 1 deletion fs/erofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ static int erofs_fill_inode(struct inode *inode, int isdir)
}

if (erofs_inode_is_data_compressed(vi->datalayout)) {
err = z_erofs_fill_inode(inode);
if (!erofs_is_fscache_mode(inode->i_sb))
err = z_erofs_fill_inode(inode);
else
err = -EOPNOTSUPP;
goto out_unlock;
}
inode->i_mapping->a_ops = &erofs_raw_access_aops;
Expand Down
Loading

0 comments on commit 8171acb

Please sign in to comment.