Skip to content

Commit 5fe326b

Browse files
committed
Merge tag 'erofs-for-6.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang: "One patch addresses a null-ptr-deref issue reported by syzbot weeks ago, which is caused by the new long xattr name prefix feature and needs to be fixed. The remaining two patches are minor cleanups to avoid unnecessary compilation and adjust per-cpu kworker configuration. Summary: - Fix null-ptr-deref related to long xattr name prefixes - Avoid pcpubuf compilation if CONFIG_EROFS_FS_ZIP is off - Use high priority kthreads by default if per-cpu kthread workers are enabled" * tag 'erofs-for-6.4-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: use HIPRI by default if per-cpu kthreads are enabled erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init
2 parents ae8373a + cf7f273 commit 5fe326b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

fs/erofs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ config EROFS_FS_PCPU_KTHREAD
121121
config EROFS_FS_PCPU_KTHREAD_HIPRI
122122
bool "EROFS high priority per-CPU kthread workers"
123123
depends on EROFS_FS_ZIP && EROFS_FS_PCPU_KTHREAD
124+
default y
124125
help
125126
This permits EROFS to configure per-CPU kthread workers to run
126127
at higher priority.

fs/erofs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

33
obj-$(CONFIG_EROFS_FS) += erofs.o
4-
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o pcpubuf.o sysfs.o
4+
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o sysfs.o
55
erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
6-
erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o
6+
erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
77
erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
88
erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o

fs/erofs/internal.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,6 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
472472
return NULL;
473473
}
474474

475-
void *erofs_get_pcpubuf(unsigned int requiredpages);
476-
void erofs_put_pcpubuf(void *ptr);
477-
int erofs_pcpubuf_growsize(unsigned int nrpages);
478-
void __init erofs_pcpubuf_init(void);
479-
void erofs_pcpubuf_exit(void);
480-
481475
int erofs_register_sysfs(struct super_block *sb);
482476
void erofs_unregister_sysfs(struct super_block *sb);
483477
int __init erofs_init_sysfs(void);
@@ -512,6 +506,11 @@ int z_erofs_load_lz4_config(struct super_block *sb,
512506
struct z_erofs_lz4_cfgs *lz4, int len);
513507
int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
514508
int flags);
509+
void *erofs_get_pcpubuf(unsigned int requiredpages);
510+
void erofs_put_pcpubuf(void *ptr);
511+
int erofs_pcpubuf_growsize(unsigned int nrpages);
512+
void __init erofs_pcpubuf_init(void);
513+
void erofs_pcpubuf_exit(void);
515514
#else
516515
static inline void erofs_shrinker_register(struct super_block *sb) {}
517516
static inline void erofs_shrinker_unregister(struct super_block *sb) {}
@@ -529,6 +528,8 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
529528
}
530529
return 0;
531530
}
531+
static inline void erofs_pcpubuf_init(void) {}
532+
static inline void erofs_pcpubuf_exit(void) {}
532533
#endif /* !CONFIG_EROFS_FS_ZIP */
533534

534535
#ifdef CONFIG_EROFS_FS_ZIP_LZMA

fs/erofs/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ int erofs_xattr_prefixes_init(struct super_block *sb)
675675
if (!pfs)
676676
return -ENOMEM;
677677

678-
if (erofs_sb_has_fragments(sbi))
678+
if (sbi->packed_inode)
679679
buf.inode = sbi->packed_inode;
680680
else
681681
erofs_init_metabuf(&buf, sb);

fs/erofs/zdata.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ static struct kthread_worker *erofs_init_percpu_worker(int cpu)
369369
return worker;
370370
if (IS_ENABLED(CONFIG_EROFS_FS_PCPU_KTHREAD_HIPRI))
371371
sched_set_fifo_low(worker->task);
372-
else
373-
sched_set_normal(worker->task, 0);
374372
return worker;
375373
}
376374

0 commit comments

Comments
 (0)