Compare
bcec7fc2e224088daf94448d663b02e0d0b9c717..89bab1dba8a0167ef0d819e0f55b6bafa038e87f
ring-buffer: Fix false warning in ring_buffer_map_get_reader()
The mmap reader can warn when it catches up with a writer that is still
committing events. rb_get_reader_page() returns NULL in this case, but
ring_buffer_map_get_reader() treats that result as an error.
The initial rb_per_cpu_empty() check filters out an empty buffer, but it
does not guarantee that the next reader page has committed data. Writers
do not take reader_lock and can advance commit_page before publishing the
committed length on the new page. rb_get_reader_page() can swap to that
page, catch up with the writer and return NULL.
Handle NULL through the existing no-data exit without warning. Remove the
caller's reader_page == commit_page check as well, since the reader-page
helper already handles that case. The existing metadata update and return
path remain in place.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260924084946.20104-1-krystianmkaniewski@gmail.com
Fixes: 117c39200d9d ("ring-buffer: Introducing ring-buffer mapping functions")
Assisted-by: Gemini:gemini-3.8-flash syzbot
Reported-by: syzbot+de3d7f9bcc9212f3fae1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=de3d7f9bcc9212f3fae1
Link: https://syzkaller.appspot.com/ai_job?id=488adc18-a10e-42d2-a205-25327c38837f
Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Krystian Kaniewski <krystianmkaniewski@gmail.com> · 2026-09-24 08:49 UTC · committed by Steven Rostedt
22 files changed,
+32
−64
- fs/9p/v9fs.h
- fs/9p/vfs_super.c
- fs/afs/internal.h
- fs/afs/super.c
- fs/ext4/ext4.h
- fs/ext4/extents-test.c
- fs/ext4/extents.c
- fs/ext4/extents_status.c
- fs/ext4/extents_status.h
- fs/ext4/super.c
- fs/ocfs2/dlm/dlmcommon.h
- fs/ocfs2/dlm/dlmdebug.c
- fs/ocfs2/dlm/dlmrecovery.c
- fs/pipe.c
- include/linux/sched/signal.h
- kernel/trace/Makefile
- kernel/trace/ring_buffer.c
- kernel/trace/trace.c
- kernel/trace/trace_events_hist.c
- kernel/trace/undefsyms_base.c
- kernel/watch_queue.c
- samples/pidfd/Makefile
modified fs/9p/v9fs.h
| @@ -137,7 +137,6 @@ struct v9fs_session_info { | |||
| 137 | 137 | struct list_head slist; /* list of sessions registered with v9fs */ | |
| 138 | 138 | struct rw_semaphore rename_sem; | |
| 139 | 139 | long session_lock_timeout; /* retry interval for blocking locks */ | |
| 140 | - | struct rcu_head rcu; /* v9fs_vfs_get_link_dotl() reads ->cache in rcu pathwalk */ | |
| 141 | 140 | }; | |
| 142 | 141 | ||
| 143 | 142 | #define NDENTRY_TIMEOUT_NEVER (-1U) | |
modified fs/9p/vfs_super.c
| @@ -173,8 +173,8 @@ static void v9fs_kill_super(struct super_block *s) | |||
| 173 | 173 | ||
| 174 | 174 | v9fs_session_cancel(v9ses); | |
| 175 | 175 | v9fs_session_close(v9ses); | |
| 176 | - | /* v9fs_vfs_get_link_dotl() may still read ->cache in rcu pathwalk */ | |
| 177 | - | kfree_rcu(v9ses, rcu); | |
| 176 | + | kfree(v9ses); | |
| 177 | + | s->s_fs_info = NULL; | |
| 178 | 178 | p9_debug(P9_DEBUG_VFS, "exiting kill_super\n"); | |
| 179 | 179 | } | |
| 180 | 180 | ||
modified fs/afs/internal.h
| @@ -251,8 +251,6 @@ struct afs_super_info { | |||
| 251 | 251 | struct afs_volume *volume; /* volume record */ | |
| 252 | 252 | enum afs_flock_mode flock_mode:8; /* File locking emulation mode */ | |
| 253 | 253 | bool dyn_root; /* True if dynamic root */ | |
| 254 | - | /* afs_atcell_get_link() reads ->net_ns in rcu pathwalk */ | |
| 255 | - | struct rcu_head rcu; | |
| 256 | 254 | }; | |
| 257 | 255 | ||
| 258 | 256 | static inline struct afs_super_info *AFS_FS_S(struct super_block *sb) | |
modified fs/afs/super.c
| @@ -523,7 +523,7 @@ static void afs_destroy_sbi(struct afs_super_info *as) | |||
| 523 | 523 | afs_put_volume(as->volume, afs_volume_trace_put_destroy_sbi); | |
| 524 | 524 | afs_unuse_cell(as->cell, afs_cell_trace_unuse_sbi); | |
| 525 | 525 | put_net(as->net_ns); | |
| 526 | - | kfree_rcu(as, rcu); | |
| 526 | + | kfree(as); | |
| 527 | 527 | } | |
| 528 | 528 | } | |
| 529 | 529 | ||
modified fs/ext4/ext4.h
| @@ -1774,8 +1774,6 @@ struct ext4_sb_info { | |||
| 1774 | 1774 | struct list_head s_es_list; /* List of inodes with reclaimable extents */ | |
| 1775 | 1775 | long s_es_nr_inode; | |
| 1776 | 1776 | struct ext4_es_stats s_es_stats; | |
| 1777 | - | /* ext4_get_link() reads the sbi in rcu pathwalk */ | |
| 1778 | - | struct rcu_head s_rcu; | |
| 1779 | 1777 | struct mb_cache *s_ea_block_cache; | |
| 1780 | 1778 | struct mb_cache *s_ea_inode_cache; | |
| 1781 | 1779 | ||
modified fs/ext4/extents-test.c
| @@ -151,7 +151,6 @@ static void extents_kunit_exit(struct kunit *test) | |||
| 151 | 151 | ||
| 152 | 152 | sbi = k_ctx.k_ei->vfs_inode.i_sb->s_fs_info; | |
| 153 | 153 | ext4_es_unregister_shrinker(sbi); | |
| 154 | - | ext4_es_destroy_stats(sbi); | |
| 155 | 154 | deactivate_super(sbi->s_sb); | |
| 156 | 155 | kfree(sbi); | |
| 157 | 156 | kfree(k_ctx.k_ei); | |
| @@ -341,7 +340,6 @@ out: | |||
| 341 | 340 | k_ctx.k_data = NULL; | |
| 342 | 341 | ||
| 343 | 342 | ext4_es_unregister_shrinker(sbi); | |
| 344 | - | ext4_es_destroy_stats(sbi); | |
| 345 | 343 | out_deactivate: | |
| 346 | 344 | deactivate_locked_super(sb); | |
| 347 | 345 | kfree(sbi); | |
modified fs/ext4/extents.c
| @@ -6409,7 +6409,6 @@ EXPORT_SYMBOL_FOR_EXT4_TEST(__ext4_ext_dirty); | |||
| 6409 | 6409 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_ext_zeroout); | |
| 6410 | 6410 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_register_shrinker); | |
| 6411 | 6411 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_unregister_shrinker); | |
| 6412 | - | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_destroy_stats); | |
| 6413 | 6412 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_map_create_blocks); | |
| 6414 | 6413 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_init_tree); | |
| 6415 | 6414 | EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_lookup_extent); | |
modified fs/ext4/extents_status.c
| @@ -1881,17 +1881,12 @@ err1: | |||
| 1881 | 1881 | } | |
| 1882 | 1882 | ||
| 1883 | 1883 | void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi) | |
| 1884 | - | { | |
| 1885 | - | shrinker_free(sbi->s_es_shrinker); | |
| 1886 | - | } | |
| 1887 | - | ||
| 1888 | - | /* ext4_get_link() bumps the hit and miss counters in rcu pathwalk */ | |
| 1889 | - | void ext4_es_destroy_stats(struct ext4_sb_info *sbi) | |
| 1890 | 1884 | { | |
| 1891 | 1885 | percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_hits); | |
| 1892 | 1886 | percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses); | |
| 1893 | 1887 | percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt); | |
| 1894 | 1888 | percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt); | |
| 1889 | + | shrinker_free(sbi->s_es_shrinker); | |
| 1895 | 1890 | } | |
| 1896 | 1891 | ||
| 1897 | 1892 | /* | |
modified fs/ext4/extents_status.h
| @@ -238,7 +238,6 @@ static inline void ext4_es_store_pblock_status(struct extent_status *es, | |||
| 238 | 238 | ||
| 239 | 239 | extern int ext4_es_register_shrinker(struct ext4_sb_info *sbi); | |
| 240 | 240 | extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi); | |
| 241 | - | extern void ext4_es_destroy_stats(struct ext4_sb_info *sbi); | |
| 242 | 241 | ||
| 243 | 242 | extern int ext4_seq_es_shrinker_info_show(struct seq_file *seq, void *v); | |
| 244 | 243 | ||
modified fs/ext4/super.c
| @@ -1279,14 +1279,6 @@ static void ext4_flex_groups_free(struct ext4_sb_info *sbi) | |||
| 1279 | 1279 | } | |
| 1280 | 1280 | } | |
| 1281 | 1281 | ||
| 1282 | - | static void ext4_put_sbi_rcu(struct rcu_head *head) | |
| 1283 | - | { | |
| 1284 | - | struct ext4_sb_info *sbi = container_of(head, struct ext4_sb_info, s_rcu); | |
| 1285 | - | ||
| 1286 | - | ext4_es_destroy_stats(sbi); | |
| 1287 | - | kfree(sbi); | |
| 1288 | - | } | |
| 1289 | - | ||
| 1290 | 1282 | static void ext4_put_super(struct super_block *sb) | |
| 1291 | 1283 | { | |
| 1292 | 1284 | struct ext4_sb_info *sbi = EXT4_SB(sb); | |
| @@ -1382,6 +1374,7 @@ static void ext4_put_super(struct super_block *sb) | |||
| 1382 | 1374 | ext4_stop_mmpd(sbi); | |
| 1383 | 1375 | ||
| 1384 | 1376 | brelse(sbi->s_sbh); | |
| 1377 | + | sb->s_fs_info = NULL; | |
| 1385 | 1378 | /* | |
| 1386 | 1379 | * Now that we are completely done shutting down the | |
| 1387 | 1380 | * superblock, we need to actually destroy the kobject. | |
| @@ -1394,8 +1387,7 @@ static void ext4_put_super(struct super_block *sb) | |||
| 1394 | 1387 | #if IS_ENABLED(CONFIG_UNICODE) | |
| 1395 | 1388 | utf8_unload(sb->s_encoding); | |
| 1396 | 1389 | #endif | |
| 1397 | - | /* ext4_get_link() reads the sbi and the counters in rcu pathwalk */ | |
| 1398 | - | call_rcu(&sbi->s_rcu, ext4_put_sbi_rcu); | |
| 1390 | + | kfree(sbi); | |
| 1399 | 1391 | } | |
| 1400 | 1392 | ||
| 1401 | 1393 | static struct kmem_cache *ext4_inode_cachep; | |
| @@ -5814,7 +5806,6 @@ failed_mount3a: | |||
| 5814 | 5806 | /* Drain deferred EA inode iputs from journal replay */ | |
| 5815 | 5807 | flush_delayed_work(&sbi->s_ea_inode_work); | |
| 5816 | 5808 | ext4_es_unregister_shrinker(sbi); | |
| 5817 | - | ext4_es_destroy_stats(sbi); | |
| 5818 | 5809 | failed_mount3: | |
| 5819 | 5810 | /* flush s_sb_upd_work before sbi destroy */ | |
| 5820 | 5811 | flush_work(&sbi->s_sb_upd_work); | |
modified fs/ocfs2/dlm/dlmcommon.h
| @@ -435,8 +435,6 @@ enum { | |||
| 435 | 435 | DLM_DEREF_LOCKRES_DONE = 522, | |
| 436 | 436 | }; | |
| 437 | 437 | ||
| 438 | - | extern spinlock_t dlm_reco_state_lock; | |
| 439 | - | ||
| 440 | 438 | struct dlm_reco_node_data | |
| 441 | 439 | { | |
| 442 | 440 | int state; | |
modified fs/ocfs2/dlm/dlmdebug.c
| @@ -736,11 +736,8 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) | |||
| 736 | 736 | buf + out, len - out); | |
| 737 | 737 | out += scnprintf(buf + out, len - out, "\n"); | |
| 738 | 738 | ||
| 739 | - | spin_unlock(&dlm->spinlock); | |
| 740 | - | ||
| 741 | 739 | /* Recovery Node State: */ | |
| 742 | 740 | out += scnprintf(buf + out, len - out, "Recovery Node State:\n"); | |
| 743 | - | spin_lock(&dlm_reco_state_lock); | |
| 744 | 741 | list_for_each_entry(node, &dlm->reco.node_data, list) { | |
| 745 | 742 | switch (node->state) { | |
| 746 | 743 | case DLM_RECO_NODE_DATA_INIT: | |
| @@ -772,7 +769,7 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len) | |||
| 772 | 769 | node->node_num, state); | |
| 773 | 770 | } | |
| 774 | 771 | ||
| 775 | - | spin_unlock(&dlm_reco_state_lock); | |
| 772 | + | spin_unlock(&dlm->spinlock); | |
| 776 | 773 | ||
| 777 | 774 | return out; | |
| 778 | 775 | } | |
modified fs/ocfs2/dlm/dlmrecovery.c
| @@ -80,7 +80,7 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm, | |||
| 80 | 80 | ||
| 81 | 81 | static u64 dlm_get_next_mig_cookie(void); | |
| 82 | 82 | ||
| 83 | - | DEFINE_SPINLOCK(dlm_reco_state_lock); | |
| 83 | + | static DEFINE_SPINLOCK(dlm_reco_state_lock); | |
| 84 | 84 | static DEFINE_SPINLOCK(dlm_mig_cookie_lock); | |
| 85 | 85 | static u64 dlm_mig_cookie = 1; | |
| 86 | 86 | ||
modified fs/pipe.c
| @@ -838,11 +838,9 @@ pipe_fasync(int fd, struct file *filp, int on) | |||
| 838 | 838 | if (filp->f_mode & FMODE_READ) | |
| 839 | 839 | retval = fasync_helper(fd, filp, on, &pipe->fasync_readers); | |
| 840 | 840 | if ((filp->f_mode & FMODE_WRITE) && retval >= 0) { | |
| 841 | - | int read_ret = retval; | |
| 842 | - | ||
| 843 | 841 | retval = fasync_helper(fd, filp, on, &pipe->fasync_writers); | |
| 844 | - | /* Undo only a reader entry added by this call. */ | |
| 845 | - | if (retval < 0 && read_ret > 0) | |
| 842 | + | if (retval < 0 && (filp->f_mode & FMODE_READ)) | |
| 843 | + | /* this can happen only if on == T */ | |
| 846 | 844 | fasync_helper(-1, filp, 0, &pipe->fasync_readers); | |
| 847 | 845 | } | |
| 848 | 846 | mutex_unlock(&pipe->mutex); | |
modified include/linux/sched/signal.h
| @@ -130,8 +130,8 @@ struct signal_struct { | |||
| 130 | 130 | * process will inherit a flag if they should look for a | |
| 131 | 131 | * child_subreaper process at exit. | |
| 132 | 132 | */ | |
| 133 | - | bool is_child_subreaper; | |
| 134 | - | bool has_child_subreaper; | |
| 133 | + | unsigned int is_child_subreaper:1; | |
| 134 | + | unsigned int has_child_subreaper:1; | |
| 135 | 135 | unsigned int autoreap:1; | |
| 136 | 136 | ||
| 137 | 137 | #ifdef CONFIG_POSIX_TIMERS | |
modified kernel/trace/Makefile
| @@ -146,11 +146,12 @@ KASAN_SANITIZE_undefsyms_base.o := y | |||
| 146 | 146 | ||
| 147 | 147 | UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \ | |
| 148 | 148 | __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \ | |
| 149 | - | $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}') | |
| 149 | + | current_thread_info_reg \ | |
| 150 | + | $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}') | |
| 150 | 151 | ||
| 151 | 152 | quiet_cmd_check_undefined = NM $< | |
| 152 | 153 | cmd_check_undefined = \ | |
| 153 | - | undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \ | |
| 154 | + | undefsyms=$$($(NM) -u $< | awk '$$2 {print $$2}' | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \ | |
| 154 | 155 | if [ -n "$$undefsyms" ]; then \ | |
| 155 | 156 | echo "Unexpected symbols in $<:" >&2; \ | |
| 156 | 157 | echo "$$undefsyms" >&2; \ | |
modified kernel/trace/ring_buffer.c
| @@ -2380,6 +2380,9 @@ int ring_buffer_meta_seq_init(struct file *file, struct trace_buffer *buffer, in | |||
| 2380 | 2380 | struct seq_file *m; | |
| 2381 | 2381 | int ret; | |
| 2382 | 2382 | ||
| 2383 | + | if (!cpumask_test_cpu(cpu, buffer->cpumask)) | |
| 2384 | + | return -ENODEV; | |
| 2385 | + | ||
| 2383 | 2386 | ret = seq_open(file, &rb_meta_seq_ops); | |
| 2384 | 2387 | if (ret) | |
| 2385 | 2388 | return ret; | |
| @@ -3627,10 +3630,8 @@ static void rb_inc_iter(struct ring_buffer_iter *iter) | |||
| 3627 | 3630 | /* Return the index into the sub-buffers for a given sub-buffer */ | |
| 3628 | 3631 | static int rb_meta_subbuf_idx(struct ring_buffer_cpu_meta *meta, void *subbuf) | |
| 3629 | 3632 | { | |
| 3630 | - | void *subbuf_array; | |
| 3633 | + | void *subbuf_array = rb_subbufs_from_meta(meta); | |
| 3631 | 3634 | ||
| 3632 | - | subbuf_array = (void *)meta + sizeof(int) * meta->nr_subbufs; | |
| 3633 | - | subbuf_array = (void *)ALIGN((unsigned long)subbuf_array, meta->subbuf_size); | |
| 3634 | 3635 | return (subbuf - subbuf_array) / meta->subbuf_size; | |
| 3635 | 3636 | } | |
| 3636 | 3637 | ||
| @@ -7997,12 +7998,8 @@ consume: | |||
| 7997 | 7998 | goto out; | |
| 7998 | 7999 | } | |
| 7999 | 8000 | ||
| 8000 | - | /* Did the reader catch up with the writer? */ | |
| 8001 | - | if (cpu_buffer->reader_page == cpu_buffer->commit_page) | |
| 8002 | - | goto out; | |
| 8003 | - | ||
| 8004 | 8001 | reader = rb_get_reader_page(cpu_buffer); | |
| 8005 | - | if (WARN_ON(!reader)) | |
| 8002 | + | if (!reader) | |
| 8006 | 8003 | goto out; | |
| 8007 | 8004 | ||
| 8008 | 8005 | /* Check if any events were dropped */ | |
modified kernel/trace/trace.c
| @@ -5881,7 +5881,7 @@ static int tracing_buffer_meta_open(struct inode *inode, struct file *filp) | |||
| 5881 | 5881 | ||
| 5882 | 5882 | ret = ring_buffer_meta_seq_init(filp, tr->array_buffer.buffer, cpu); | |
| 5883 | 5883 | if (ret < 0) | |
| 5884 | - | __trace_array_put(tr); | |
| 5884 | + | trace_array_put(tr); | |
| 5885 | 5885 | return ret; | |
| 5886 | 5886 | } | |
| 5887 | 5887 | ||
modified kernel/trace/trace_events_hist.c
| @@ -289,7 +289,7 @@ static u64 hist_field_log2(struct hist_field *hist_field, | |||
| 289 | 289 | ||
| 290 | 290 | u64 val = hist_fn_call(operand, elt, buffer, rbe, event); | |
| 291 | 291 | ||
| 292 | - | return (u64) ilog2(roundup_pow_of_two(val)); | |
| 292 | + | return order_base_2(val); | |
| 293 | 293 | } | |
| 294 | 294 | ||
| 295 | 295 | static u64 hist_field_bucket(struct hist_field *hist_field, | |
| @@ -3090,7 +3090,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data, | |||
| 3090 | 3090 | key_field = hist_data->fields[i]; | |
| 3091 | 3091 | if (!first) | |
| 3092 | 3092 | seq_buf_putc(&s, ','); | |
| 3093 | - | seq_buf_puts(&s, key_field->field->name); | |
| 3093 | + | expr_field_str(key_field, &s); | |
| 3094 | 3094 | first = false; | |
| 3095 | 3095 | } | |
| 3096 | 3096 | ||
modified kernel/trace/undefsyms_base.c
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | 10 | #include <linux/atomic.h> | |
| 11 | 11 | #include <linux/string.h> | |
| 12 | + | #include <asm/local.h> | |
| 12 | 13 | #include <asm/page.h> | |
| 13 | 14 | ||
| 14 | 15 | void undefsyms_base(void *p, int n); | |
| @@ -18,11 +19,13 @@ static char page[PAGE_SIZE] __aligned(PAGE_SIZE); | |||
| 18 | 19 | void undefsyms_base(void *p, int n) | |
| 19 | 20 | { | |
| 20 | 21 | char buffer[256] = { 0 }; | |
| 21 | - | ||
| 22 | 22 | u32 u = 0; | |
| 23 | + | ||
| 23 | 24 | memset((char * volatile)page, 8, PAGE_SIZE); | |
| 24 | 25 | memset((char * volatile)buffer, 8, sizeof(buffer)); | |
| 25 | 26 | memcpy((void * volatile)p, buffer, sizeof(buffer)); | |
| 26 | 27 | cmpxchg((u32 * volatile)&u, 0, 8); | |
| 28 | + | cmpxchg((unsigned long *)p, 0, 8); | |
| 29 | + | local_set((local_t *)p, 8); | |
| 27 | 30 | WARN_ON(n == 0xdeadbeef); | |
| 28 | 31 | } | |
modified kernel/watch_queue.c
| @@ -101,7 +101,7 @@ static bool post_one_notification(struct watch_queue *wqueue, | |||
| 101 | 101 | struct pipe_inode_info *pipe = wqueue->pipe; | |
| 102 | 102 | struct pipe_buffer *buf; | |
| 103 | 103 | struct page *page; | |
| 104 | - | unsigned int head, tail, note, offset, len, nr_notes; | |
| 104 | + | unsigned int head, tail, note, offset, len; | |
| 105 | 105 | bool done = false; | |
| 106 | 106 | ||
| 107 | 107 | spin_lock_irq(&pipe->rd_wait.lock); | |
| @@ -111,10 +111,8 @@ static bool post_one_notification(struct watch_queue *wqueue, | |||
| 111 | 111 | if (pipe_full(head, tail, pipe->ring_size)) | |
| 112 | 112 | goto lost; | |
| 113 | 113 | ||
| 114 | - | /* Pairs with the smp_store_release() in watch_queue_set_size(). */ | |
| 115 | - | nr_notes = smp_load_acquire(&wqueue->nr_notes); | |
| 116 | - | note = find_first_bit(wqueue->notes_bitmap, nr_notes); | |
| 117 | - | if (note >= nr_notes) | |
| 114 | + | note = find_first_bit(wqueue->notes_bitmap, wqueue->nr_notes); | |
| 115 | + | if (note >= wqueue->nr_notes) | |
| 118 | 116 | goto lost; | |
| 119 | 117 | ||
| 120 | 118 | page = wqueue->notes[note / WATCH_QUEUE_NOTES_PER_PAGE]; | |
| @@ -299,8 +297,7 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes) | |||
| 299 | 297 | wqueue->notes = pages; | |
| 300 | 298 | wqueue->notes_bitmap = bitmap; | |
| 301 | 299 | wqueue->nr_pages = nr_pages; | |
| 302 | - | /* Pairs with the smp_load_acquire() in post_one_notification(). */ | |
| 303 | - | smp_store_release(&wqueue->nr_notes, nr_notes); | |
| 300 | + | wqueue->nr_notes = nr_notes; | |
| 304 | 301 | return 0; | |
| 305 | 302 | ||
| 306 | 303 | error_p: | |
modified samples/pidfd/Makefile
| @@ -1,4 +1,4 @@ | |||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 | |
| 2 | - | userprogs-always-y += pidfd-metadata | |
| 2 | + | usertprogs-always-y += pidfd-metadata | |
| 3 | 3 | ||
| 4 | 4 | userccflags += -I usr/include | |