Skip to content

Commit 0b1dcc2

Browse files
committed
Merge tag 'mm-hotfixes-stable-2022-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull hotfixes from Andrew Morton: "24 MM and non-MM hotfixes. 8 marked cc:stable and 16 for post-6.0 issues. There have been a lot of hotfixes this cycle, and this is quite a large batch given how far we are into the -rc cycle. Presumably a reflection of the unusually large amount of MM material which went into 6.1-rc1" * tag 'mm-hotfixes-stable-2022-11-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (24 commits) test_kprobes: fix implicit declaration error of test_kprobes nilfs2: fix nilfs_sufile_mark_dirty() not set segment usage as dirty mm/cgroup/reclaim: fix dirty pages throttling on cgroup v1 mm: fix unexpected changes to {failslab|fail_page_alloc}.attr swapfile: fix soft lockup in scan_swap_map_slots hugetlb: fix __prep_compound_gigantic_page page flag setting kfence: fix stack trace pruning proc/meminfo: fix spacing in SecPageTables mm: multi-gen LRU: retry folios written back while isolated mailmap: update email address for Satya Priya mm/migrate_device: return number of migrating pages in args->cpages kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible MAINTAINERS: update Alex Hung's email address mailmap: update Alex Hung's email address mm: mmap: fix documentation for vma_mas_szero mm/damon/sysfs-schemes: skip stats update if the scheme directory is removed mm/memory: return vm_fault_t result from migrate_to_ram() callback mm: correctly charge compressed memory to its memcg ipc/shm: call underlying open/close vm_ops gcov: clang: fix the buffer overflow issue ...
2 parents b308570 + de3db3f commit 0b1dcc2

24 files changed

+173
-79
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Alexandre Belloni <[email protected]> <alexandre.belloni@free-electr
2929
Alexei Starovoitov <[email protected]> <[email protected]>
3030
Alexei Starovoitov <[email protected]> <[email protected]>
3131
Alexei Starovoitov <[email protected]> <[email protected]>
32+
3233
3334
3435
@@ -382,6 +383,7 @@ Santosh Shilimkar <[email protected]>
382383
Santosh Shilimkar <[email protected]>
383384
Sarangdhar Joshi <[email protected]>
384385
Sascha Hauer <[email protected]>
386+
385387
S.Çağlar Onur <[email protected]>
386388
Sean Christopherson <[email protected]> <[email protected]>
387389

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10287,7 +10287,7 @@ T: git https://github.com/intel/gvt-linux.git
1028710287
F: drivers/gpu/drm/i915/gvt/
1028810288

1028910289
INTEL HID EVENT DRIVER
10290-
M: Alex Hung <alex.hung@canonical.com>
10290+
M: Alex Hung <alexhung@gmail.com>
1029110291
1029210292
S: Maintained
1029310293
F: drivers/platform/x86/intel/hid.c

fs/nilfs2/sufile.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,14 +495,22 @@ void nilfs_sufile_do_free(struct inode *sufile, __u64 segnum,
495495
int nilfs_sufile_mark_dirty(struct inode *sufile, __u64 segnum)
496496
{
497497
struct buffer_head *bh;
498+
void *kaddr;
499+
struct nilfs_segment_usage *su;
498500
int ret;
499501

502+
down_write(&NILFS_MDT(sufile)->mi_sem);
500503
ret = nilfs_sufile_get_segment_usage_block(sufile, segnum, 0, &bh);
501504
if (!ret) {
502505
mark_buffer_dirty(bh);
503506
nilfs_mdt_mark_dirty(sufile);
507+
kaddr = kmap_atomic(bh->b_page);
508+
su = nilfs_sufile_block_get_segment_usage(sufile, segnum, bh, kaddr);
509+
nilfs_segment_usage_set_dirty(su);
510+
kunmap_atomic(kaddr);
504511
brelse(bh);
505512
}
513+
up_write(&NILFS_MDT(sufile)->mi_sem);
506514
return ret;
507515
}
508516

fs/proc/meminfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
115115
#endif
116116
show_val_kb(m, "PageTables: ",
117117
global_node_page_state(NR_PAGETABLE));
118-
show_val_kb(m, "SecPageTables: ",
118+
show_val_kb(m, "SecPageTables: ",
119119
global_node_page_state(NR_SECONDARY_PAGETABLE));
120120

121121
show_val_kb(m, "NFS_Unstable: ", 0);

include/linux/fault-inject.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ struct fault_attr {
2020
atomic_t space;
2121
unsigned long verbose;
2222
bool task_filter;
23-
bool no_warn;
2423
unsigned long stacktrace_depth;
2524
unsigned long require_start;
2625
unsigned long require_end;
@@ -32,6 +31,10 @@ struct fault_attr {
3231
struct dentry *dname;
3332
};
3433

34+
enum fault_flags {
35+
FAULT_NOWARN = 1 << 0,
36+
};
37+
3538
#define FAULT_ATTR_INITIALIZER { \
3639
.interval = 1, \
3740
.times = ATOMIC_INIT(1), \
@@ -40,11 +43,11 @@ struct fault_attr {
4043
.ratelimit_state = RATELIMIT_STATE_INIT_DISABLED, \
4144
.verbose = 2, \
4245
.dname = NULL, \
43-
.no_warn = false, \
4446
}
4547

4648
#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
4749
int setup_fault_attr(struct fault_attr *attr, char *str);
50+
bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags);
4851
bool should_fail(struct fault_attr *attr, ssize_t size);
4952

5053
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS

include/linux/license.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef __LICENSE_H
33
#define __LICENSE_H
44

5+
#include <linux/string.h>
6+
57
static inline int license_is_gpl_compatible(const char *license)
68
{
79
return (strcmp(license, "GPL") == 0

include/trace/events/huge_memory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ TRACE_EVENT(mm_collapse_huge_page_swapin,
171171

172172
TRACE_EVENT(mm_khugepaged_scan_file,
173173

174-
TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
174+
TP_PROTO(struct mm_struct *mm, struct page *page, struct file *file,
175175
int present, int swap, int result),
176176

177-
TP_ARGS(mm, page, filename, present, swap, result),
177+
TP_ARGS(mm, page, file, present, swap, result),
178178

179179
TP_STRUCT__entry(
180180
__field(struct mm_struct *, mm)
181181
__field(unsigned long, pfn)
182-
__string(filename, filename)
182+
__string(filename, file->f_path.dentry->d_iname)
183183
__field(int, present)
184184
__field(int, swap)
185185
__field(int, result)
@@ -188,7 +188,7 @@ TRACE_EVENT(mm_khugepaged_scan_file,
188188
TP_fast_assign(
189189
__entry->mm = mm;
190190
__entry->pfn = page ? page_to_pfn(page) : -1;
191-
__assign_str(filename, filename);
191+
__assign_str(filename, file->f_path.dentry->d_iname);
192192
__entry->present = present;
193193
__entry->swap = swap;
194194
__entry->result = result;

ipc/shm.c

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,8 @@ static inline void shm_rmid(struct shmid_kernel *s)
275275
}
276276

277277

278-
static int __shm_open(struct vm_area_struct *vma)
278+
static int __shm_open(struct shm_file_data *sfd)
279279
{
280-
struct file *file = vma->vm_file;
281-
struct shm_file_data *sfd = shm_file_data(file);
282280
struct shmid_kernel *shp;
283281

284282
shp = shm_lock(sfd->ns, sfd->id);
@@ -302,7 +300,15 @@ static int __shm_open(struct vm_area_struct *vma)
302300
/* This is called by fork, once for every shm attach. */
303301
static void shm_open(struct vm_area_struct *vma)
304302
{
305-
int err = __shm_open(vma);
303+
struct file *file = vma->vm_file;
304+
struct shm_file_data *sfd = shm_file_data(file);
305+
int err;
306+
307+
/* Always call underlying open if present */
308+
if (sfd->vm_ops->open)
309+
sfd->vm_ops->open(vma);
310+
311+
err = __shm_open(sfd);
306312
/*
307313
* We raced in the idr lookup or with shm_destroy().
308314
* Either way, the ID is busted.
@@ -359,10 +365,8 @@ static bool shm_may_destroy(struct shmid_kernel *shp)
359365
* The descriptor has already been removed from the current->mm->mmap list
360366
* and will later be kfree()d.
361367
*/
362-
static void shm_close(struct vm_area_struct *vma)
368+
static void __shm_close(struct shm_file_data *sfd)
363369
{
364-
struct file *file = vma->vm_file;
365-
struct shm_file_data *sfd = shm_file_data(file);
366370
struct shmid_kernel *shp;
367371
struct ipc_namespace *ns = sfd->ns;
368372

@@ -388,6 +392,18 @@ static void shm_close(struct vm_area_struct *vma)
388392
up_write(&shm_ids(ns).rwsem);
389393
}
390394

395+
static void shm_close(struct vm_area_struct *vma)
396+
{
397+
struct file *file = vma->vm_file;
398+
struct shm_file_data *sfd = shm_file_data(file);
399+
400+
/* Always call underlying close if present */
401+
if (sfd->vm_ops->close)
402+
sfd->vm_ops->close(vma);
403+
404+
__shm_close(sfd);
405+
}
406+
391407
/* Called with ns->shm_ids(ns).rwsem locked */
392408
static int shm_try_destroy_orphaned(int id, void *p, void *data)
393409
{
@@ -583,13 +599,13 @@ static int shm_mmap(struct file *file, struct vm_area_struct *vma)
583599
* IPC ID that was removed, and possibly even reused by another shm
584600
* segment already. Propagate this case as an error to caller.
585601
*/
586-
ret = __shm_open(vma);
602+
ret = __shm_open(sfd);
587603
if (ret)
588604
return ret;
589605

590606
ret = call_mmap(sfd->file, vma);
591607
if (ret) {
592-
shm_close(vma);
608+
__shm_close(sfd);
593609
return ret;
594610
}
595611
sfd->vm_ops = vma->vm_ops;

kernel/gcov/clang.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ void gcov_info_add(struct gcov_info *dst, struct gcov_info *src)
280280

281281
for (i = 0; i < sfn_ptr->num_counters; i++)
282282
dfn_ptr->counters[i] += sfn_ptr->counters[i];
283+
284+
sfn_ptr = list_next_entry(sfn_ptr, head);
283285
}
284286
}
285287

lib/Kconfig.debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,7 @@ config KPROBES_SANITY_TEST
21072107
depends on DEBUG_KERNEL
21082108
depends on KPROBES
21092109
depends on KUNIT
2110+
select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
21102111
default KUNIT_ALL_TESTS
21112112
help
21122113
This option provides for testing basic kprobes functionality on

0 commit comments

Comments
 (0)