Skip to content

Commit a3b397b

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "16 patches. Subsystems affected by this patch series: xtensa, sh, ocfs2, scripts, lib, and mm (memory-failure, kasan, damon, shmem, tools, pagecache, debug, and pagemap)" * emailed patches from Andrew Morton <[email protected]>: mm: fix uninitialized use in overcommit_policy_handler mm/memory_failure: fix the missing pte_unmap() call kasan: always respect CONFIG_KASAN_STACK sh: pgtable-3level: fix cast to pointer from integer of different size mm/debug: sync up latest migrate_reason to migrate_reason_names mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN mm: fs: invalidate bh_lrus for only cold path lib/zlib_inflate/inffast: check config in C to avoid unused function warning tools/vm/page-types: remove dependency on opt_file for idle page tracking scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error ocfs2: drop acl cache for directories too mm/shmem.c: fix judgment error in shmem_is_huge() xtensa: increase size of gcc stack frame check mm/damon: don't use strnlen() with known-bogus source length kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable()
2 parents bb19237 + bcbda81 commit a3b397b

File tree

17 files changed

+69
-39
lines changed

17 files changed

+69
-39
lines changed

arch/sh/include/asm/pgtable-3level.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef struct { unsigned long long pmd; } pmd_t;
3434

3535
static inline pmd_t *pud_pgtable(pud_t pud)
3636
{
37-
return (pmd_t *)pud_val(pud);
37+
return (pmd_t *)(unsigned long)pud_val(pud);
3838
}
3939

4040
/* only used by the stubbed out hugetlb gup code, should never be called */

fs/buffer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,12 +1425,16 @@ void invalidate_bh_lrus(void)
14251425
}
14261426
EXPORT_SYMBOL_GPL(invalidate_bh_lrus);
14271427

1428-
void invalidate_bh_lrus_cpu(int cpu)
1428+
/*
1429+
* It's called from workqueue context so we need a bh_lru_lock to close
1430+
* the race with preemption/irq.
1431+
*/
1432+
void invalidate_bh_lrus_cpu(void)
14291433
{
14301434
struct bh_lru *b;
14311435

14321436
bh_lru_lock();
1433-
b = per_cpu_ptr(&bh_lrus, cpu);
1437+
b = this_cpu_ptr(&bh_lrus);
14341438
__invalidate_bh_lrus(b);
14351439
bh_lru_unlock();
14361440
}

fs/ocfs2/dlmglue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
39513951
oi = OCFS2_I(inode);
39523952
oi->ip_dir_lock_gen++;
39533953
mlog(0, "generation: %u\n", oi->ip_dir_lock_gen);
3954-
goto out;
3954+
goto out_forget;
39553955
}
39563956

39573957
if (!S_ISREG(inode->i_mode))
@@ -3982,6 +3982,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
39823982
filemap_fdatawait(mapping);
39833983
}
39843984

3985+
out_forget:
39853986
forget_all_cached_acls(inode);
39863987

39873988
out:

include/linux/buffer_head.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void __breadahead_gfp(struct block_device *, sector_t block, unsigned int size,
194194
struct buffer_head *__bread_gfp(struct block_device *,
195195
sector_t block, unsigned size, gfp_t gfp);
196196
void invalidate_bh_lrus(void);
197-
void invalidate_bh_lrus_cpu(int cpu);
197+
void invalidate_bh_lrus_cpu(void);
198198
bool has_bh_in_lru(int cpu, void *dummy);
199199
struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
200200
void free_buffer_head(struct buffer_head * bh);
@@ -408,7 +408,7 @@ static inline int inode_has_buffers(struct inode *inode) { return 0; }
408408
static inline void invalidate_inode_buffers(struct inode *inode) {}
409409
static inline int remove_inode_buffers(struct inode *inode) { return 1; }
410410
static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
411-
static inline void invalidate_bh_lrus_cpu(int cpu) {}
411+
static inline void invalidate_bh_lrus_cpu(void) {}
412412
static inline bool has_bh_in_lru(int cpu, void *dummy) { return false; }
413413
#define buffer_heads_over_limit 0
414414

include/linux/migrate.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ struct migration_target_control;
1919
*/
2020
#define MIGRATEPAGE_SUCCESS 0
2121

22+
/*
23+
* Keep sync with:
24+
* - macro MIGRATE_REASON in include/trace/events/migrate.h
25+
* - migrate_reason_names[MR_TYPES] in mm/debug.c
26+
*/
2227
enum migrate_reason {
2328
MR_COMPACTION,
2429
MR_MEMORY_FAILURE,
@@ -32,7 +37,6 @@ enum migrate_reason {
3237
MR_TYPES
3338
};
3439

35-
/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */
3640
extern const char *migrate_reason_names[MR_TYPES];
3741

3842
#ifdef CONFIG_MIGRATION

lib/Kconfig.debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ config FRAME_WARN
346346
int "Warn for stack frames larger than"
347347
range 0 8192
348348
default 2048 if GCC_PLUGIN_LATENT_ENTROPY
349-
default 1536 if (!64BIT && PARISC)
349+
default 1536 if (!64BIT && (PARISC || XTENSA))
350350
default 1024 if (!64BIT && !PARISC)
351351
default 2048 if 64BIT
352352
help

lib/Kconfig.kasan

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ choice
6666
config KASAN_GENERIC
6767
bool "Generic mode"
6868
depends on HAVE_ARCH_KASAN && CC_HAS_KASAN_GENERIC
69+
depends on CC_HAS_WORKING_NOSANITIZE_ADDRESS
6970
select SLUB_DEBUG if SLUB
7071
select CONSTRUCTORS
7172
help
@@ -86,6 +87,7 @@ config KASAN_GENERIC
8687
config KASAN_SW_TAGS
8788
bool "Software tag-based mode"
8889
depends on HAVE_ARCH_KASAN_SW_TAGS && CC_HAS_KASAN_SW_TAGS
90+
depends on CC_HAS_WORKING_NOSANITIZE_ADDRESS
8991
select SLUB_DEBUG if SLUB
9092
select CONSTRUCTORS
9193
help

lib/zlib_inflate/inffast.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,12 @@ void inflate_fast(z_streamp strm, unsigned start)
253253

254254
sfrom = (unsigned short *)(from);
255255
loops = len >> 1;
256-
do
257-
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
258-
*sout++ = *sfrom++;
259-
#else
260-
*sout++ = get_unaligned16(sfrom++);
261-
#endif
262-
while (--loops);
256+
do {
257+
if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))
258+
*sout++ = *sfrom++;
259+
else
260+
*sout++ = get_unaligned16(sfrom++);
261+
} while (--loops);
263262
out = (unsigned char *)sout;
264263
from = (unsigned char *)sfrom;
265264
} else { /* dist == 1 or dist == 2 */

mm/damon/dbgfs-test.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,57 +20,57 @@ static void damon_dbgfs_test_str_to_target_ids(struct kunit *test)
2020
ssize_t nr_integers = 0, i;
2121

2222
question = "123";
23-
answers = str_to_target_ids(question, strnlen(question, 128),
23+
answers = str_to_target_ids(question, strlen(question),
2424
&nr_integers);
2525
KUNIT_EXPECT_EQ(test, (ssize_t)1, nr_integers);
2626
KUNIT_EXPECT_EQ(test, 123ul, answers[0]);
2727
kfree(answers);
2828

2929
question = "123abc";
30-
answers = str_to_target_ids(question, strnlen(question, 128),
30+
answers = str_to_target_ids(question, strlen(question),
3131
&nr_integers);
3232
KUNIT_EXPECT_EQ(test, (ssize_t)1, nr_integers);
3333
KUNIT_EXPECT_EQ(test, 123ul, answers[0]);
3434
kfree(answers);
3535

3636
question = "a123";
37-
answers = str_to_target_ids(question, strnlen(question, 128),
37+
answers = str_to_target_ids(question, strlen(question),
3838
&nr_integers);
3939
KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
4040
kfree(answers);
4141

4242
question = "12 35";
43-
answers = str_to_target_ids(question, strnlen(question, 128),
43+
answers = str_to_target_ids(question, strlen(question),
4444
&nr_integers);
4545
KUNIT_EXPECT_EQ(test, (ssize_t)2, nr_integers);
4646
for (i = 0; i < nr_integers; i++)
4747
KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
4848
kfree(answers);
4949

5050
question = "12 35 46";
51-
answers = str_to_target_ids(question, strnlen(question, 128),
51+
answers = str_to_target_ids(question, strlen(question),
5252
&nr_integers);
5353
KUNIT_EXPECT_EQ(test, (ssize_t)3, nr_integers);
5454
for (i = 0; i < nr_integers; i++)
5555
KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
5656
kfree(answers);
5757

5858
question = "12 35 abc 46";
59-
answers = str_to_target_ids(question, strnlen(question, 128),
59+
answers = str_to_target_ids(question, strlen(question),
6060
&nr_integers);
6161
KUNIT_EXPECT_EQ(test, (ssize_t)2, nr_integers);
6262
for (i = 0; i < 2; i++)
6363
KUNIT_EXPECT_EQ(test, expected[i], answers[i]);
6464
kfree(answers);
6565

6666
question = "";
67-
answers = str_to_target_ids(question, strnlen(question, 128),
67+
answers = str_to_target_ids(question, strlen(question),
6868
&nr_integers);
6969
KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
7070
kfree(answers);
7171

7272
question = "\n";
73-
answers = str_to_target_ids(question, strnlen(question, 128),
73+
answers = str_to_target_ids(question, strlen(question),
7474
&nr_integers);
7575
KUNIT_EXPECT_EQ(test, (ssize_t)0, nr_integers);
7676
kfree(answers);

mm/debug.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const char *migrate_reason_names[MR_TYPES] = {
2424
"syscall_or_cpuset",
2525
"mempolicy_mbind",
2626
"numa_misplaced",
27-
"cma",
27+
"contig_range",
28+
"longterm_pin",
29+
"demotion",
2830
};
2931

3032
const struct trace_print_flags pageflag_names[] = {

0 commit comments

Comments
 (0)