Skip to content

Commit d76bb1e

Browse files
committed
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
2 parents 707df33 + 35076d2 commit d76bb1e

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8727,6 +8727,7 @@ M: Chao Yu <chao@kernel.org>
87278727
R: Yue Hu <zbestahu@gmail.com>
87288728
R: Jeffle Xu <jefflexu@linux.alibaba.com>
87298729
R: Sandeep Dhavale <dhavale@google.com>
8730+
R: Hongbo Li <lihongbo22@huawei.com>
87308731
L: linux-erofs@lists.ozlabs.org
87318732
S: Maintained
87328733
W: https://erofs.docs.kernel.org

fs/erofs/fileio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ static int erofs_fileio_scan_folio(struct erofs_fileio *io, struct folio *folio)
150150
io->rq->bio.bi_iter.bi_sector = io->dev.m_pa >> 9;
151151
attached = 0;
152152
}
153-
if (!attached++)
154-
erofs_onlinefolio_split(folio);
155153
if (!bio_add_folio(&io->rq->bio, folio, len, cur))
156154
goto io_retry;
155+
if (!attached++)
156+
erofs_onlinefolio_split(folio);
157157
io->dev.m_pa += len;
158158
}
159159
cur += len;

fs/erofs/super.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ static void erofs_default_options(struct erofs_sb_info *sbi)
357357
enum {
358358
Opt_user_xattr, Opt_acl, Opt_cache_strategy, Opt_dax, Opt_dax_enum,
359359
Opt_device, Opt_fsid, Opt_domain_id, Opt_directio,
360-
Opt_err
361360
};
362361

363362
static const struct constant_table erofs_param_cache_strategy[] = {

fs/erofs/zdata.c

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ struct z_erofs_pcluster {
7979
/* L: whether partial decompression or not */
8080
bool partial;
8181

82-
/* L: indicate several pageofs_outs or not */
83-
bool multibases;
84-
8582
/* L: whether extra buffer allocations are best-effort */
8683
bool besteffort;
8784

@@ -1046,8 +1043,6 @@ static int z_erofs_scan_folio(struct z_erofs_frontend *f,
10461043
break;
10471044

10481045
erofs_onlinefolio_split(folio);
1049-
if (f->pcl->pageofs_out != (map->m_la & ~PAGE_MASK))
1050-
f->pcl->multibases = true;
10511046
if (f->pcl->length < offset + end - map->m_la) {
10521047
f->pcl->length = offset + end - map->m_la;
10531048
f->pcl->pageofs_out = map->m_la & ~PAGE_MASK;
@@ -1093,7 +1088,6 @@ struct z_erofs_backend {
10931088
struct page *onstack_pages[Z_EROFS_ONSTACK_PAGES];
10941089
struct super_block *sb;
10951090
struct z_erofs_pcluster *pcl;
1096-
10971091
/* pages with the longest decompressed length for deduplication */
10981092
struct page **decompressed_pages;
10991093
/* pages to keep the compressed data */
@@ -1102,6 +1096,8 @@ struct z_erofs_backend {
11021096
struct list_head decompressed_secondary_bvecs;
11031097
struct page **pagepool;
11041098
unsigned int onstack_used, nr_pages;
1099+
/* indicate if temporary copies should be preserved for later use */
1100+
bool keepxcpy;
11051101
};
11061102

11071103
struct z_erofs_bvec_item {
@@ -1112,18 +1108,20 @@ struct z_erofs_bvec_item {
11121108
static void z_erofs_do_decompressed_bvec(struct z_erofs_backend *be,
11131109
struct z_erofs_bvec *bvec)
11141110
{
1111+
int poff = bvec->offset + be->pcl->pageofs_out;
11151112
struct z_erofs_bvec_item *item;
1116-
unsigned int pgnr;
1117-
1118-
if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK) &&
1119-
(bvec->end == PAGE_SIZE ||
1120-
bvec->offset + bvec->end == be->pcl->length)) {
1121-
pgnr = (bvec->offset + be->pcl->pageofs_out) >> PAGE_SHIFT;
1122-
DBG_BUGON(pgnr >= be->nr_pages);
1123-
if (!be->decompressed_pages[pgnr]) {
1124-
be->decompressed_pages[pgnr] = bvec->page;
1113+
struct page **page;
1114+
1115+
if (!(poff & ~PAGE_MASK) && (bvec->end == PAGE_SIZE ||
1116+
bvec->offset + bvec->end == be->pcl->length)) {
1117+
DBG_BUGON((poff >> PAGE_SHIFT) >= be->nr_pages);
1118+
page = be->decompressed_pages + (poff >> PAGE_SHIFT);
1119+
if (!*page) {
1120+
*page = bvec->page;
11251121
return;
11261122
}
1123+
} else {
1124+
be->keepxcpy = true;
11271125
}
11281126

11291127
/* (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)
12891287
.alg = pcl->algorithmformat,
12901288
.inplace_io = overlapped,
12911289
.partial_decoding = pcl->partial,
1292-
.fillgaps = pcl->multibases,
1290+
.fillgaps = be->keepxcpy,
12931291
.gfp = pcl->besteffort ? GFP_KERNEL :
12941292
GFP_NOWAIT | __GFP_NORETRY
12951293
}, be->pagepool);
@@ -1346,7 +1344,6 @@ static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, int err)
13461344

13471345
pcl->length = 0;
13481346
pcl->partial = true;
1349-
pcl->multibases = false;
13501347
pcl->besteffort = false;
13511348
pcl->bvset.nextpage = NULL;
13521349
pcl->vcnt = 0;

0 commit comments

Comments
 (0)