Changes since last update:

- Add a new reviewer, Hongbo Li, for better community development;
 
  - Fix an I/O hang out of file-backed mounts;
 
  - Address a rare data corruption caused by concurrent I/Os on the
    same deduplicated compressed data;
 
  - Minor cleanup.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEQ0A6bDUS9Y+83NPFUXZn5Zlu5qoFAmgbfD0RHHhpYW5nQGtl
 cm5lbC5vcmcACgkQUXZn5Zlu5qq0HQ//YliUecA8b8KCLLuDyAsJijCJJt2FKiNO
 x2G+lUdAy7xwrWWW874rPFtY18hl0Gs7P0HKYCB3/6ftWQ713Rf95d7DUTSGJDGP
 EAiywh4GdVWGzsEoIiaN3bmwsPopEOptu9NE+IubOX931waOMrHyY5gViTMOofU/
 gyx0OT6kuvQgCpUeIkrlPAww6Fn84hPgNkgINb6pscatQqmmKMmJou1pjBgeS+Zm
 HKLDMMbJbucWvaoXEMLGmkzVjkY8qEkFUykv3b1nocxxcAcmEH2ee5qJEE4LRetR
 +psBE8wDgcPUXXbb7a9v7LzzsnADZrUqsuNojRN4WgZsF7bPM5w2xvWgw/N4Aujr
 UsthM1G6tM3NlTL6FgVT+5eNBWhA7RnAvOdhjqgnsZalq4vXQ3R3xgtmgsTQaZge
 FtINBfeilBrM+EQ9cmd31rtSTPHkMprHD5VFOTml9L5nh5Hn+j6HYtAf3dTtS5qz
 8jBld26wZSIhAYTr3Q9Q2ixOk68/ZNIfSYa8ey86ed0K8GVheKziYoekwfEnhiZ+
 O/a6y5cHGV8/5oakUERbkZKgNl8nODrV2CTcFr0dDfTBgzr/yUSenoAzBIVsY4xp
 UFpjGf2cPqKzAUwifrDAWdANk/d7HnARVm4FcxqJ9LB43DfhvrOHw9mprcLSvHJD
 V7IamMpCW8Q=
 =b+bQ
 -----END PGP SIGNATURE-----

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

Pull erofs fixes from Gao Xiang:

 - Add a new reviewer, Hongbo Li, for better community development

 - Fix an I/O hang out of file-backed mounts

 - Address a rare data corruption caused by concurrent I/Os on the same
   deduplicated compressed data

 - Minor cleanup

* tag 'erofs-for-6.15-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: ensure the extra temporary copy is valid for shortened bvecs
  erofs: remove unused enum type
  fs/erofs/fileio: call erofs_onlinefolio_split() after bio_add_folio()
  MAINTAINERS: erofs: add myself as reviewer
This commit is contained in:
Linus Torvalds 2025-05-07 10:19:47 -07:00
commit d76bb1ebb5
4 changed files with 16 additions and 19 deletions

View File

@ -8727,6 +8727,7 @@ M: Chao Yu <chao@kernel.org>
R: Yue Hu <zbestahu@gmail.com>
R: Jeffle Xu <jefflexu@linux.alibaba.com>
R: Sandeep Dhavale <dhavale@google.com>
R: Hongbo Li <lihongbo22@huawei.com>
L: linux-erofs@lists.ozlabs.org
S: Maintained
W: https://erofs.docs.kernel.org

View File

@ -150,10 +150,10 @@ io_retry:
io->rq->bio.bi_iter.bi_sector = io->dev.m_pa >> 9;
attached = 0;
}
if (!attached++)
erofs_onlinefolio_split(folio);
if (!bio_add_folio(&io->rq->bio, folio, len, cur))
goto io_retry;
if (!attached++)
erofs_onlinefolio_split(folio);
io->dev.m_pa += len;
}
cur += len;

View File

@ -357,7 +357,6 @@ static void erofs_default_options(struct erofs_sb_info *sbi)
enum {
Opt_user_xattr, Opt_acl, Opt_cache_strategy, Opt_dax, Opt_dax_enum,
Opt_device, Opt_fsid, Opt_domain_id, Opt_directio,
Opt_err
};
static const struct constant_table erofs_param_cache_strategy[] = {

View File

@ -79,9 +79,6 @@ struct z_erofs_pcluster {
/* L: whether partial decompression or not */
bool partial;
/* L: indicate several pageofs_outs or not */
bool multibases;
/* L: whether extra buffer allocations are best-effort */
bool besteffort;
@ -1046,8 +1043,6 @@ static int z_erofs_scan_folio(struct z_erofs_frontend *f,
break;
erofs_onlinefolio_split(folio);
if (f->pcl->pageofs_out != (map->m_la & ~PAGE_MASK))
f->pcl->multibases = true;
if (f->pcl->length < offset + end - map->m_la) {
f->pcl->length = offset + end - map->m_la;
f->pcl->pageofs_out = map->m_la & ~PAGE_MASK;
@ -1093,7 +1088,6 @@ struct z_erofs_backend {
struct page *onstack_pages[Z_EROFS_ONSTACK_PAGES];
struct super_block *sb;
struct z_erofs_pcluster *pcl;
/* pages with the longest decompressed length for deduplication */
struct page **decompressed_pages;
/* pages to keep the compressed data */
@ -1102,6 +1096,8 @@ struct z_erofs_backend {
struct list_head decompressed_secondary_bvecs;
struct page **pagepool;
unsigned int onstack_used, nr_pages;
/* indicate if temporary copies should be preserved for later use */
bool keepxcpy;
};
struct z_erofs_bvec_item {
@ -1112,18 +1108,20 @@ struct z_erofs_bvec_item {
static void z_erofs_do_decompressed_bvec(struct z_erofs_backend *be,
struct z_erofs_bvec *bvec)
{
int poff = bvec->offset + be->pcl->pageofs_out;
struct z_erofs_bvec_item *item;
unsigned int pgnr;
struct page **page;
if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK) &&
(bvec->end == PAGE_SIZE ||
bvec->offset + bvec->end == be->pcl->length)) {
pgnr = (bvec->offset + be->pcl->pageofs_out) >> PAGE_SHIFT;
DBG_BUGON(pgnr >= be->nr_pages);
if (!be->decompressed_pages[pgnr]) {
be->decompressed_pages[pgnr] = bvec->page;
if (!(poff & ~PAGE_MASK) && (bvec->end == PAGE_SIZE ||
bvec->offset + bvec->end == be->pcl->length)) {
DBG_BUGON((poff >> PAGE_SHIFT) >= be->nr_pages);
page = be->decompressed_pages + (poff >> PAGE_SHIFT);
if (!*page) {
*page = bvec->page;
return;
}
} else {
be->keepxcpy = true;
}
/* (cold path) one pcluster is requested multiple times */
@ -1289,7 +1287,7 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, int err)
.alg = pcl->algorithmformat,
.inplace_io = overlapped,
.partial_decoding = pcl->partial,
.fillgaps = pcl->multibases,
.fillgaps = be->keepxcpy,
.gfp = pcl->besteffort ? GFP_KERNEL :
GFP_NOWAIT | __GFP_NORETRY
}, be->pagepool);
@ -1346,7 +1344,6 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, int err)
pcl->length = 0;
pcl->partial = true;
pcl->multibases = false;
pcl->besteffort = false;
pcl->bvset.nextpage = NULL;
pcl->vcnt = 0;