From: "Darrick J. Wong" <djwong(a)kernel.org>
stable inclusion
from stable-v6.1.92
commit 4db0e08ef9aceee6947ebdb387439b5600e7564f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBB6IN
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
--------------------------------
[ Upstream commit 76e589013fec672c3587d6314f2d1f0aeddc26d9 ]
In the next patch, we're going to prohibit log recovery if the primary
superblock contains an unrecognized rocompat feature bit even on
readonly mounts. This requires removing all the code in the log
mounting process that temporarily disables the readonly state.
Unfortunately, inode inactivation disables itself on readonly mounts.
Clearing the iunlinked lists after log recovery needs inactivation to
run to free the unreferenced inodes, which (AFAICT) is the only reason
why log mounting plays games with the readonly state in the first place.
Therefore, change the inactivation predicates to allow inactivation
during log recovery of a readonly mount.
Fixes: 400cf2265d55 ("[Backport] xfs: fix log recovery when unknown rocompat bits are set")
Signed-off-by: Darrick J. Wong <djwong(a)kernel.org>
Reviewed-by: Dave Chinner <dchinner(a)redhat.com>
Signed-off-by: Leah Rumancik <leah.rumancik(a)gmail.com>
Acked-by: Darrick J. Wong <djwong(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Zizhi Wo <wozizhi(a)huawei.com>
---
fs/xfs/xfs_inode.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index f77a27f73bb5..3230cc0ff722 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1841,8 +1841,11 @@ xfs_inode_needs_inactive(
if (VFS_I(ip)->i_mode == 0)
return false;
- /* If this is a read-only mount, don't do this (would generate I/O) */
- if (xfs_is_readonly(mp))
+ /*
+ * If this is a read-only mount, don't do this (would generate I/O)
+ * unless we're in log recovery and cleaning the iunlinked list.
+ */
+ if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
return false;
/* If the log isn't running, push inodes straight to reclaim. */
@@ -1902,8 +1905,11 @@ xfs_inactive(
mp = ip->i_mount;
ASSERT(!xfs_iflags_test(ip, XFS_IRECOVERY));
- /* If this is a read-only mount, don't do this (would generate I/O) */
- if (xfs_is_readonly(mp))
+ /*
+ * If this is a read-only mount, don't do this (would generate I/O)
+ * unless we're in log recovery and cleaning the iunlinked list.
+ */
+ if (xfs_is_readonly(mp) && !xlog_recovery_needed(mp->m_log))
goto out;
/* Metadata inodes require explicit resource cleanup. */
--
2.46.1
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: d68dc6ee371ec5466be9b2d76bdca0b360940adc
commit: dba6c8bad729e1971c31053550e9686127ce3844 [1636/1636] LoongArch: KVM: Add PV IPI support on host side
config: loongarch-randconfig-002-20241213 (https://download.01.org/0day-ci/archive/20241214/202412140300.AvxBVNVW-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412140300.AvxBVNVW-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412140300.AvxBVNVW-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/loongarch/kernel/paravirt.c: In function 'pv_send_ipi_single':
>> arch/loongarch/kernel/paravirt.c:85:24: error: 'KVM_HCALL_FUNC_PV_IPI' undeclared (first use in this function); did you mean 'KVM_HCALL_FUNC_IPI'?
85 | kvm_hypercall3(KVM_HCALL_FUNC_PV_IPI, 1, 0, min);
| ^~~~~~~~~~~~~~~~~~~~~
| KVM_HCALL_FUNC_IPI
arch/loongarch/kernel/paravirt.c:85:24: note: each undeclared identifier is reported only once for each function it appears in
arch/loongarch/kernel/paravirt.c: In function 'pv_send_ipi_mask':
arch/loongarch/kernel/paravirt.c:119:40: error: 'KVM_HCALL_FUNC_PV_IPI' undeclared (first use in this function); did you mean 'KVM_HCALL_FUNC_IPI'?
119 | kvm_hypercall3(KVM_HCALL_FUNC_PV_IPI,
| ^~~~~~~~~~~~~~~~~~~~~
| KVM_HCALL_FUNC_IPI
vim +85 arch/loongarch/kernel/paravirt.c
f860ab821dd12f5 Bibo Mao 2024-03-22 73
462dd429f52a765 Bibo Mao 2024-03-01 74 #ifdef CONFIG_SMP
462dd429f52a765 Bibo Mao 2024-03-01 75 static void pv_send_ipi_single(int cpu, unsigned int action)
462dd429f52a765 Bibo Mao 2024-03-01 76 {
462dd429f52a765 Bibo Mao 2024-03-01 77 unsigned int min, old;
462dd429f52a765 Bibo Mao 2024-03-01 78 irq_cpustat_t *info = &per_cpu(irq_stat, cpu);
462dd429f52a765 Bibo Mao 2024-03-01 79
462dd429f52a765 Bibo Mao 2024-03-01 80 old = atomic_fetch_or(BIT(action), &info->message);
462dd429f52a765 Bibo Mao 2024-03-01 81 if (old)
462dd429f52a765 Bibo Mao 2024-03-01 82 return;
462dd429f52a765 Bibo Mao 2024-03-01 83
462dd429f52a765 Bibo Mao 2024-03-01 84 min = cpu_logical_map(cpu);
462dd429f52a765 Bibo Mao 2024-03-01 @85 kvm_hypercall3(KVM_HCALL_FUNC_PV_IPI, 1, 0, min);
462dd429f52a765 Bibo Mao 2024-03-01 86 }
462dd429f52a765 Bibo Mao 2024-03-01 87
:::::: The code at line 85 was first introduced by commit
:::::: 462dd429f52a7659ea1c74f02f7134a43fccccc8 LoongArch: Add pv ipi support on guest kernel side
:::::: TO: Bibo Mao <maobibo(a)loongson.cn>
:::::: CC: Xianglai Li <lixianglai(a)loongson.cn>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: d68dc6ee371ec5466be9b2d76bdca0b360940adc
commit: bd254ad9ed5fb35dc87b90f98ebb805567ff0472 [1636/1636] LoongArch: KVM: Add irqfd support
config: loongarch-randconfig-001-20241213 (https://download.01.org/0day-ci/archive/20241214/202412140030.ws7cfuVO-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412140030.ws7cfuVO-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412140030.ws7cfuVO-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/loongarch/kvm/intc/pch_pic.c: In function 'kvm_setup_default_irq_routing':
>> arch/loongarch/kvm/intc/pch_pic.c:459:16: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
459 | int i, ret;
| ^~~
--
>> arch/loongarch/kvm/irqfd.c:81: warning: Function parameter or member 'e' not described in 'kvm_set_msi'
>> arch/loongarch/kvm/irqfd.c:81: warning: Function parameter or member 'kvm' not described in 'kvm_set_msi'
>> arch/loongarch/kvm/irqfd.c:81: warning: Function parameter or member 'irq_source_id' not described in 'kvm_set_msi'
>> arch/loongarch/kvm/irqfd.c:81: warning: Function parameter or member 'level' not described in 'kvm_set_msi'
>> arch/loongarch/kvm/irqfd.c:81: warning: Function parameter or member 'line_status' not described in 'kvm_set_msi'
vim +/ret +459 arch/loongarch/kvm/intc/pch_pic.c
453
454 static int kvm_setup_default_irq_routing(struct kvm *kvm)
455 {
456 struct kvm_irq_routing_entry *entries;
457
458 u32 nr = KVM_IRQCHIP_NUM_PINS;
> 459 int i, ret;
460
461 entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL);
462 if (!entries)
463 return -ENOMEM;
464
465 for (i = 0; i < nr; i++) {
466 entries[i].gsi = i;
467 entries[i].type = KVM_IRQ_ROUTING_IRQCHIP;
468 entries[i].u.irqchip.irqchip = 0;
469 entries[i].u.irqchip.pin = i;
470 }
471 ret = kvm_set_irq_routing(kvm, entries, nr, 0);
472 kfree(entries);
473
474 return 0;
475 }
476
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: d68dc6ee371ec5466be9b2d76bdca0b360940adc
commit: 2ee1b090fed0f14944d85db83f5dbc33fbe812ec [1636/1636] LoongArch: KVM: Add PV steal time support in guest side
config: loongarch-randconfig-002-20241213 (https://download.01.org/0day-ci/archive/20241213/202412132355.qfya7e74-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241213/202412132355.qfya7e74-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412132355.qfya7e74-lkp@intel.com/
All warnings (new ones prefixed by >>):
| ^~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:81:1: note: in expansion of macro 'early_param'
81 | early_param("no-steal-acc", parse_no_stealacc);
| ^~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:111:12: error: redefinition of 'paravt_steal_clock'
111 | static u64 paravt_steal_clock(int cpu)
| ^~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:83:12: note: previous definition of 'paravt_steal_clock' with type 'u64(int)' {aka 'long long unsigned int(int)'}
83 | static u64 paravt_steal_clock(int cpu)
| ^~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c: In function 'pv_send_ipi_single':
arch/loongarch/kernel/paravirt.c:141:24: error: 'KVM_HCALL_FUNC_PV_IPI' undeclared (first use in this function); did you mean 'KVM_HCALL_FUNC_IPI'?
141 | kvm_hypercall3(KVM_HCALL_FUNC_PV_IPI, 1, 0, min);
| ^~~~~~~~~~~~~~~~~~~~~
| KVM_HCALL_FUNC_IPI
arch/loongarch/kernel/paravirt.c:141:24: note: each undeclared identifier is reported only once for each function it appears in
arch/loongarch/kernel/paravirt.c: In function 'pv_send_ipi_mask':
arch/loongarch/kernel/paravirt.c:175:40: error: 'KVM_HCALL_FUNC_PV_IPI' undeclared (first use in this function); did you mean 'KVM_HCALL_FUNC_IPI'?
175 | kvm_hypercall3(KVM_HCALL_FUNC_PV_IPI,
| ^~~~~~~~~~~~~~~~~~~~~
| KVM_HCALL_FUNC_IPI
arch/loongarch/kernel/paravirt.c: At top level:
arch/loongarch/kernel/paravirt.c:363:13: error: redefinition of 'pv_disable_steal_time'
363 | static void pv_disable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:224:13: note: previous definition of 'pv_disable_steal_time' with type 'void(void)'
224 | static void pv_disable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:393:13: error: redefinition of 'pv_cpu_reboot'
393 | static void pv_cpu_reboot(void *unused)
| ^~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:289:13: note: previous definition of 'pv_cpu_reboot' with type 'void(void *)'
289 | static void pv_cpu_reboot(void *unused)
| ^~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:398:12: error: redefinition of 'pv_reboot_notify'
398 | static int pv_reboot_notify(struct notifier_block *nb, unsigned long code, void *unused)
| ^~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:294:12: note: previous definition of 'pv_reboot_notify' with type 'int(struct notifier_block *, long unsigned int, void *)'
294 | static int pv_reboot_notify(struct notifier_block *nb, unsigned long code,
| ^~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:404:30: error: redefinition of 'pv_reboot_nb'
404 | static struct notifier_block pv_reboot_nb = {
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:301:30: note: previous definition of 'pv_reboot_nb' with type 'struct notifier_block'
301 | static struct notifier_block pv_reboot_nb = {
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:408:12: error: redefinition of 'pv_time_init'
408 | int __init pv_time_init(void)
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:305:12: note: previous definition of 'pv_time_init' with type 'int(void)'
305 | int __init pv_time_init(void)
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:453:12: error: redefinition of 'pv_enable_steal_time'
453 | static int pv_enable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:339:12: note: previous definition of 'pv_enable_steal_time' with type 'int(void)'
339 | static int pv_enable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:477:13: error: redefinition of 'pv_disable_steal_time'
477 | static void pv_disable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:363:13: note: previous definition of 'pv_disable_steal_time' with type 'void(void)'
363 | static void pv_disable_steal_time(void)
| ^~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:484:12: error: redefinition of 'pv_time_cpu_online'
484 | static int pv_time_cpu_online(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:370:12: note: previous definition of 'pv_time_cpu_online' with type 'int(unsigned int)'
370 | static int pv_time_cpu_online(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:495:12: error: redefinition of 'pv_time_cpu_down_prepare'
495 | static int pv_time_cpu_down_prepare(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:381:12: note: previous definition of 'pv_time_cpu_down_prepare' with type 'int(unsigned int)'
381 | static int pv_time_cpu_down_prepare(unsigned int cpu)
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:507:13: error: redefinition of 'pv_cpu_reboot'
507 | static void pv_cpu_reboot(void *unused)
| ^~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:393:13: note: previous definition of 'pv_cpu_reboot' with type 'void(void *)'
393 | static void pv_cpu_reboot(void *unused)
| ^~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:512:12: error: redefinition of 'pv_reboot_notify'
512 | static int pv_reboot_notify(struct notifier_block *nb, unsigned long code, void *unused)
| ^~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:398:12: note: previous definition of 'pv_reboot_notify' with type 'int(struct notifier_block *, long unsigned int, void *)'
398 | static int pv_reboot_notify(struct notifier_block *nb, unsigned long code, void *unused)
| ^~~~~~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:518:30: error: redefinition of 'pv_reboot_nb'
518 | static struct notifier_block pv_reboot_nb = {
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:404:30: note: previous definition of 'pv_reboot_nb' with type 'struct notifier_block'
404 | static struct notifier_block pv_reboot_nb = {
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:522:12: error: redefinition of 'pv_time_init'
522 | int __init pv_time_init(void)
| ^~~~~~~~~~~~
arch/loongarch/kernel/paravirt.c:305:12: note: previous definition of 'pv_time_init' with type 'int(void)'
305 | int __init pv_time_init(void)
| ^~~~~~~~~~~~
>> arch/loongarch/kernel/paravirt.c:83:12: warning: 'paravt_steal_clock' defined but not used [-Wunused-function]
83 | static u64 paravt_steal_clock(int cpu)
| ^~~~~~~~~~~~~~~~~~
vim +/paravt_steal_clock +83 arch/loongarch/kernel/paravirt.c
82
> 83 static u64 paravt_steal_clock(int cpu)
84 {
85 int version;
86 u64 steal;
87 struct kvm_steal_time *src;
88
89 src = &per_cpu(steal_time, cpu);
90 do {
91
92 version = src->version;
93 virt_rmb(); /* Make sure that the version is read before the steal */
94 steal = src->steal;
95 virt_rmb(); /* Make sure that the steal is read before the next version */
96
97 } while ((version & 1) || (version != src->version));
98
99 return steal;
100 }
101
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: d68dc6ee371ec5466be9b2d76bdca0b360940adc
commit: 35da19c3c6d4b053eba09a0daa6063eae81e928a [1636/1636] LoongArch: KVM: Add PCHPIC read and write functions
config: loongarch-randconfig-001-20241213 (https://download.01.org/0day-ci/archive/20241213/202412132352.24cSlwix-lkp@…)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241213/202412132352.24cSlwix-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412132352.24cSlwix-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/loongarch/kvm/vm.c: In function 'kvm_vm_ioctl_irq_line':
>> arch/loongarch/kvm/vm.c:115:30: warning: variable 'vcpus' set but not used [-Wunused-but-set-variable]
115 | int type, vcpu, irq, vcpus, val, ret = 0;
| ^~~~~
>> arch/loongarch/kvm/vm.c:115:19: warning: variable 'vcpu' set but not used [-Wunused-but-set-variable]
115 | int type, vcpu, irq, vcpus, val, ret = 0;
| ^~~~
vim +/vcpus +115 arch/loongarch/kvm/vm.c
109
110 int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *data,
111 bool line_status)
112 {
113 bool level;
114 struct loongarch_pch_pic *s;
> 115 int type, vcpu, irq, vcpus, val, ret = 0;
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki