Skip to content

Commit ce93692

Browse files
committed
Merge tag 'erofs-for-6.19-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fix from Gao Xiang: "Junbeom reported that synchronous reads could hit unintended EIOs under memory pressure due to incorrect error propagation in z_erofs_decompress_queue(), where earlier physical clusters in the same decompression queue may be served for another readahead. This addresses the issue by decompressing each physical cluster independently as long as disk I/Os succeed, rather than being impacted by the error status of previous physical clusters in the same queue. Summary: - Fix unexpected EIOs under memory pressure caused by recent incorrect error propagation logic" * tag 'erofs-for-6.19-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix unexpected EIO under memory pressure
2 parents ebb8719 + 4012d78 commit ce93692

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/erofs/zdata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,15 +1262,15 @@ static int z_erofs_parse_in_bvecs(struct z_erofs_backend *be, bool *overlapped)
12621262
return err;
12631263
}
12641264

1265-
static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, int err)
1265+
static int z_erofs_decompress_pcluster(struct z_erofs_backend *be, bool eio)
12661266
{
12671267
struct erofs_sb_info *const sbi = EROFS_SB(be->sb);
12681268
struct z_erofs_pcluster *pcl = be->pcl;
12691269
unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
12701270
const struct z_erofs_decompressor *alg =
12711271
z_erofs_decomp[pcl->algorithmformat];
12721272
bool try_free = true;
1273-
int i, j, jtop, err2;
1273+
int i, j, jtop, err2, err = eio ? -EIO : 0;
12741274
struct page *page;
12751275
bool overlapped;
12761276
const char *reason;
@@ -1413,12 +1413,12 @@ static int z_erofs_decompress_queue(const struct z_erofs_decompressqueue *io,
14131413
.pcl = io->head,
14141414
};
14151415
struct z_erofs_pcluster *next;
1416-
int err = io->eio ? -EIO : 0;
1416+
int err = 0;
14171417

14181418
for (; be.pcl != Z_EROFS_PCLUSTER_TAIL; be.pcl = next) {
14191419
DBG_BUGON(!be.pcl);
14201420
next = READ_ONCE(be.pcl->next);
1421-
err = z_erofs_decompress_pcluster(&be, err) ?: err;
1421+
err = z_erofs_decompress_pcluster(&be, io->eio) ?: err;
14221422
}
14231423
return err;
14241424
}

0 commit comments

Comments
 (0)