Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull erofs fixes from Gao Xiang:

- Mark I/Os as failed when encountering short reads on file-backed
mounts

- Label GFP_NOIO in the BIO completion when the completion is in the
process context, and directly call into the decompression to avoid
deadlocks

- Improve Kconfig descriptions to better highlight the overall efforts

- Fix .fadvise() for page cache sharing

* tag 'erofs-for-7.0-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
erofs: fix .fadvise() for page cache sharing
erofs: update the Kconfig description
erofs: add GFP_NOIO in the bio completion if needed
erofs: set fileio bio failed in short read case

+47 -20
+29 -14
fs/erofs/Kconfig
··· 16 16 select ZLIB_INFLATE if EROFS_FS_ZIP_DEFLATE 17 17 select ZSTD_DECOMPRESS if EROFS_FS_ZIP_ZSTD 18 18 help 19 - EROFS (Enhanced Read-Only File System) is a lightweight read-only 20 - file system with modern designs (e.g. no buffer heads, inline 21 - xattrs/data, chunk-based deduplication, multiple devices, etc.) for 22 - scenarios which need high-performance read-only solutions, e.g. 23 - smartphones with Android OS, LiveCDs and high-density hosts with 24 - numerous containers; 19 + EROFS (Enhanced Read-Only File System) is a modern, lightweight, 20 + secure read-only filesystem for various use cases, such as immutable 21 + system images, container images, application sandboxes, and datasets. 25 22 26 - It also provides transparent compression and deduplication support to 27 - improve storage density and maintain relatively high compression 28 - ratios, and it implements in-place decompression to temporarily reuse 29 - page cache for compressed data using proper strategies, which is 30 - quite useful for ensuring guaranteed end-to-end runtime decompression 23 + EROFS uses a flexible, hierarchical on-disk design so that features 24 + can be enabled on demand: the core on-disk format is block-aligned in 25 + order to perform optimally on all kinds of devices, including block 26 + and memory-backed devices; the format is easy to parse and has zero 27 + metadata redundancy, unlike generic filesystems, making it ideal for 28 + filesystem auditing and remote access; inline data, random-access 29 + friendly directory data, inline/shared extended attributes and 30 + chunk-based deduplication ensure space efficiency while maintaining 31 + high performance. 32 + 33 + Optionally, it supports multiple devices to reference external data, 34 + enabling data sharing for container images. 35 + 36 + It also has advanced encoded on-disk layouts, particularly for data 37 + compression and fine-grained deduplication. It utilizes fixed-size 38 + output compression to improve storage density while keeping relatively 39 + high compression ratios. Furthermore, it implements in-place 40 + decompression to reuse file pages to keep compressed data temporarily 41 + with proper strategies, which ensures guaranteed end-to-end runtime 31 42 performance under extreme memory pressure without extra cost. 32 43 33 - See the documentation at <file:Documentation/filesystems/erofs.rst> 34 - and the web pages at <https://erofs.docs.kernel.org> for more details. 44 + For more details, see the web pages at <https://erofs.docs.kernel.org> 45 + and the documentation at <file:Documentation/filesystems/erofs.rst>. 46 + 47 + To compile EROFS filesystem support as a module, choose M here. The 48 + module will be called erofs. 35 49 36 50 If unsure, say N. 37 51 ··· 119 105 depends on EROFS_FS 120 106 default y 121 107 help 122 - Enable transparent compression support for EROFS file systems. 108 + Enable EROFS compression layouts so that filesystems containing 109 + compressed files can be parsed by the kernel. 123 110 124 111 If you don't want to enable compression feature, say N. 125 112
+2 -4
fs/erofs/fileio.c
··· 25 25 container_of(iocb, struct erofs_fileio_rq, iocb); 26 26 struct folio_iter fi; 27 27 28 - if (ret >= 0 && ret != rq->bio.bi_iter.bi_size) { 29 - bio_advance(&rq->bio, ret); 30 - zero_fill_bio(&rq->bio); 31 - } 28 + if (ret >= 0 && ret != rq->bio.bi_iter.bi_size) 29 + ret = -EIO; 32 30 if (!rq->bio.bi_end_io) { 33 31 bio_for_each_folio_all(fi, &rq->bio) { 34 32 DBG_BUGON(folio_test_uptodate(fi.folio));
+13 -2
fs/erofs/ishare.c
··· 200 200 201 201 int __init erofs_init_ishare(void) 202 202 { 203 - erofs_ishare_mnt = kern_mount(&erofs_anon_fs_type); 204 - return PTR_ERR_OR_ZERO(erofs_ishare_mnt); 203 + struct vfsmount *mnt; 204 + int ret; 205 + 206 + mnt = kern_mount(&erofs_anon_fs_type); 207 + if (IS_ERR(mnt)) 208 + return PTR_ERR(mnt); 209 + /* generic_fadvise() doesn't work if s_bdi == &noop_backing_dev_info */ 210 + ret = super_setup_bdi(mnt->mnt_sb); 211 + if (ret) 212 + kern_unmount(mnt); 213 + else 214 + erofs_ishare_mnt = mnt; 215 + return ret; 205 216 } 206 217 207 218 void erofs_exit_ishare(void)
+3
fs/erofs/zdata.c
··· 1445 1445 int bios) 1446 1446 { 1447 1447 struct erofs_sb_info *const sbi = EROFS_SB(io->sb); 1448 + int gfp_flag; 1448 1449 1449 1450 /* wake up the caller thread for sync decompression */ 1450 1451 if (io->sync) { ··· 1478 1477 sbi->sync_decompress = EROFS_SYNC_DECOMPRESS_FORCE_ON; 1479 1478 return; 1480 1479 } 1480 + gfp_flag = memalloc_noio_save(); 1481 1481 z_erofs_decompressqueue_work(&io->u.work); 1482 + memalloc_noio_restore(gfp_flag); 1482 1483 } 1483 1484 1484 1485 static void z_erofs_fill_bio_vec(struct bio_vec *bvec,