Skip to content

Commit 8171acb

Browse files
committed
Merge tag 'erofs-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/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
2 parents e5b0208 + 4398d3c commit 8171acb

File tree

5 files changed

+136
-151
lines changed

5 files changed

+136
-151
lines changed

Documentation/filesystems/erofs.rst

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,82 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
33
======================================
4-
Enhanced Read-Only File System - EROFS
4+
EROFS - Enhanced Read-Only File System
55
======================================
66

77
Overview
88
========
99

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

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

1622
- read-only storage media or
1723

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

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

2733
Here is the main features of EROFS:
2834

2935
- Little endian on-disk design;
3036

31-
- Currently 4KB block size (nobh) and therefore maximum 16TB address space;
32-
33-
- Metadata & data could be mixed by design;
37+
- 4KiB block size and 32-bit block addresses, therefore 16TiB address space
38+
at most for now;
3439

35-
- 2 inode versions for different requirements:
40+
- Two inode layouts for different requirements:
3641

37-
===================== ============ =====================================
42+
===================== ============ ======================================
3843
compact (v1) extended (v2)
39-
===================== ============ =====================================
44+
===================== ============ ======================================
4045
Inode metadata size 32 bytes 64 bytes
41-
Max file size 4 GB 16 EB (also limited by max. vol size)
46+
Max file size 4 GiB 16 EiB (also limited by max. vol size)
4247
Max uids/gids 65536 4294967296
4348
Per-inode timestamp no yes (64 + 32-bit timestamp)
4449
Max hardlinks 65536 4294967296
45-
Metadata reserved 4 bytes 14 bytes
46-
===================== ============ =====================================
50+
Metadata reserved 8 bytes 18 bytes
51+
===================== ============ ======================================
52+
53+
- Metadata and data could be mixed as an option;
4754

4855
- Support extended attributes (xattrs) as an option;
4956

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

5260
- Support POSIX.1e ACLs by using xattrs;
5361

5462
- Support transparent data compression as an option:
55-
LZ4 algorithm with the fixed-sized output compression for high performance;
63+
LZ4 and MicroLZMA algorithms can be used on a per-file basis; In addition,
64+
inplace decompression is also supported to avoid bounce compressed buffers
65+
and page cache thrashing.
66+
67+
- Support direct I/O on uncompressed files to avoid double caching for loop
68+
devices;
5669

57-
- Multiple device support for multi-layer container images.
70+
- Support FSDAX on uncompressed images for secure containers and ramdisks in
71+
order to get rid of unnecessary page cache.
72+
73+
- Support multiple devices for multi blob container images;
74+
75+
- Support file-based on-demand loading with the Fscache infrastructure.
5876

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

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

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

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

229-
Chunk-based file
230-
----------------
249+
Chunk-based files
250+
-----------------
231251
In order to support chunk-based data deduplication, a new inode data layout has
232252
been supported since Linux v5.15: Files are split in equal-sized data chunks
233253
with ``extents`` area of the inode metadata indicating how to get the chunk

fs/erofs/fscache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ static struct netfs_io_request *erofs_fscache_alloc_request(struct address_space
1717
rreq->start = start;
1818
rreq->len = len;
1919
rreq->mapping = mapping;
20+
rreq->inode = mapping->host;
2021
INIT_LIST_HEAD(&rreq->subrequests);
2122
refcount_set(&rreq->ref, 1);
2223
return rreq;

fs/erofs/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ static int erofs_fill_inode(struct inode *inode, int isdir)
288288
}
289289

290290
if (erofs_inode_is_data_compressed(vi->datalayout)) {
291-
err = z_erofs_fill_inode(inode);
291+
if (!erofs_is_fscache_mode(inode->i_sb))
292+
err = z_erofs_fill_inode(inode);
293+
else
294+
err = -EOPNOTSUPP;
292295
goto out_unlock;
293296
}
294297
inode->i_mapping->a_ops = &erofs_raw_access_aops;

0 commit comments

Comments
 (0)