Skip to content

Commit 556c942

Browse files
committed
Merge tag 'erofs-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang: - Fix data corruption caused by insufficient decompression on deduplicated compressed extents - Drop a useless s_magic checking in erofs_kill_sb() * tag 'erofs-for-6.5-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: drop unnecessary WARN_ON() in erofs_kill_sb() erofs: fix wrong primary bvec selection on deduplicated extents
2 parents 5e0ba14 + 4da3c71 commit 556c942

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

fs/erofs/super.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,6 @@ static void erofs_kill_sb(struct super_block *sb)
889889
{
890890
struct erofs_sb_info *sbi;
891891

892-
WARN_ON(sb->s_magic != EROFS_SUPER_MAGIC);
893-
894892
/* pseudo mount for anon inodes */
895893
if (sb->s_flags & SB_KERNMOUNT) {
896894
kill_anon_super(sb);

fs/erofs/zdata.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,11 @@ static void z_erofs_do_decompressed_bvec(struct z_erofs_decompress_backend *be,
11441144
struct z_erofs_bvec *bvec)
11451145
{
11461146
struct z_erofs_bvec_item *item;
1147+
unsigned int pgnr;
11471148

1148-
if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK)) {
1149-
unsigned int pgnr;
1150-
1149+
if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK) &&
1150+
(bvec->end == PAGE_SIZE ||
1151+
bvec->offset + bvec->end == be->pcl->length)) {
11511152
pgnr = (bvec->offset + be->pcl->pageofs_out) >> PAGE_SHIFT;
11521153
DBG_BUGON(pgnr >= be->nr_pages);
11531154
if (!be->decompressed_pages[pgnr]) {

0 commit comments

Comments
 (0)