Skip to content

Commit 388a810

Browse files
committed
Merge tag 'erofs-for-6.3-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang: "The most important one reverts an improper fix which can cause an unexpected warning more often on specific images, and another one fixes LZMA decompression on 32-bit platforms. The others are minor fixes and cleanups. - Fix LZMA decompression failure on HIGHMEM platforms - Revert an inproper fix since it is actually an implementation issue of vmalloc() - Avoid a wrong DBG_BUGON since it could be triggered with -EINTR - Minor cleanups" * tag 'erofs-for-6.3-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: use wrapper i_blocksize() in erofs_file_read_iter() erofs: get rid of a useless DBG_BUGON erofs: Revert "erofs: fix kvcalloc() misuse with __GFP_NOFAIL" erofs: fix wrong kunmap when using LZMA on HIGHMEM platforms erofs: mark z_erofs_lzma_init/erofs_pcpubuf_init w/ __init
2 parents 92cadfc + 3993f4f commit 388a810

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

fs/erofs/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
376376
if (bdev)
377377
blksize_mask = bdev_logical_block_size(bdev) - 1;
378378
else
379-
blksize_mask = (1 << inode->i_blkbits) - 1;
379+
blksize_mask = i_blocksize(inode) - 1;
380380

381381
if ((iocb->ki_pos | iov_iter_count(to) |
382382
iov_iter_alignment(to)) & blksize_mask)

fs/erofs/decompressor_lzma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void z_erofs_lzma_exit(void)
4747
}
4848
}
4949

50-
int z_erofs_lzma_init(void)
50+
int __init z_erofs_lzma_init(void)
5151
{
5252
unsigned int i;
5353

@@ -278,7 +278,7 @@ int z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq,
278278
}
279279
}
280280
if (no < nrpages_out && strm->buf.out)
281-
kunmap(rq->in[no]);
281+
kunmap(rq->out[no]);
282282
if (ni < nrpages_in)
283283
kunmap(rq->in[ni]);
284284
/* 4. push back LZMA stream context to the global list */

fs/erofs/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
486486
void *erofs_get_pcpubuf(unsigned int requiredpages);
487487
void erofs_put_pcpubuf(void *ptr);
488488
int erofs_pcpubuf_growsize(unsigned int nrpages);
489-
void erofs_pcpubuf_init(void);
489+
void __init erofs_pcpubuf_init(void);
490490
void erofs_pcpubuf_exit(void);
491491

492492
int erofs_register_sysfs(struct super_block *sb);
@@ -545,7 +545,7 @@ static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP;
545545
#endif /* !CONFIG_EROFS_FS_ZIP */
546546

547547
#ifdef CONFIG_EROFS_FS_ZIP_LZMA
548-
int z_erofs_lzma_init(void);
548+
int __init z_erofs_lzma_init(void);
549549
void z_erofs_lzma_exit(void);
550550
int z_erofs_load_lzma_config(struct super_block *sb,
551551
struct erofs_super_block *dsb,

fs/erofs/pcpubuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages)
114114
return ret;
115115
}
116116

117-
void erofs_pcpubuf_init(void)
117+
void __init erofs_pcpubuf_init(void)
118118
{
119119
int cpu;
120120

fs/erofs/zdata.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,12 +1312,12 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
13121312

13131313
if (!be->decompressed_pages)
13141314
be->decompressed_pages =
1315-
kcalloc(be->nr_pages, sizeof(struct page *),
1316-
GFP_KERNEL | __GFP_NOFAIL);
1315+
kvcalloc(be->nr_pages, sizeof(struct page *),
1316+
GFP_KERNEL | __GFP_NOFAIL);
13171317
if (!be->compressed_pages)
13181318
be->compressed_pages =
1319-
kcalloc(pclusterpages, sizeof(struct page *),
1320-
GFP_KERNEL | __GFP_NOFAIL);
1319+
kvcalloc(pclusterpages, sizeof(struct page *),
1320+
GFP_KERNEL | __GFP_NOFAIL);
13211321

13221322
z_erofs_parse_out_bvecs(be);
13231323
err2 = z_erofs_parse_in_bvecs(be, &overlapped);
@@ -1365,7 +1365,7 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
13651365
}
13661366
if (be->compressed_pages < be->onstack_pages ||
13671367
be->compressed_pages >= be->onstack_pages + Z_EROFS_ONSTACK_PAGES)
1368-
kfree(be->compressed_pages);
1368+
kvfree(be->compressed_pages);
13691369
z_erofs_fill_other_copies(be, err);
13701370

13711371
for (i = 0; i < be->nr_pages; ++i) {
@@ -1384,7 +1384,7 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
13841384
}
13851385

13861386
if (be->decompressed_pages != be->onstack_pages)
1387-
kfree(be->decompressed_pages);
1387+
kvfree(be->decompressed_pages);
13881388

13891389
pcl->length = 0;
13901390
pcl->partial = true;

fs/erofs/zmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,6 @@ int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
757757
err = z_erofs_do_map_blocks(inode, map, flags);
758758
out:
759759
trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err);
760-
761-
/* aggressively BUG_ON iff CONFIG_EROFS_FS_DEBUG is on */
762-
DBG_BUGON(err < 0 && err != -ENOMEM);
763760
return err;
764761
}
765762

0 commit comments

Comments
 (0)