Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: spell out fenced ->i_state accesses with explicit smp_wmb/smp_rmb

The incomming helpers don't ship with _release/_acquire variants, for
the time being anyway.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Mateusz Guzik and committed by
Christian Brauner
cb5db358 af6023e2

+6 -4
+3 -2
fs/fs-writeback.c
··· 476 476 switched = true; 477 477 skip_switch: 478 478 /* 479 - * Paired with load_acquire in unlocked_inode_to_wb_begin() and 479 + * Paired with an acquire fence in unlocked_inode_to_wb_begin() and 480 480 * ensures that the new wb is visible if they see !I_WB_SWITCH. 481 481 */ 482 - smp_store_release(&inode->i_state, inode->i_state & ~I_WB_SWITCH); 482 + smp_wmb(); 483 + inode->i_state &= ~I_WB_SWITCH; 483 484 484 485 xa_unlock_irq(&mapping->i_pages); 485 486 spin_unlock(&inode->i_lock);
+3 -2
include/linux/backing-dev.h
··· 277 277 rcu_read_lock(); 278 278 279 279 /* 280 - * Paired with store_release in inode_switch_wbs_work_fn() and 280 + * Paired with a release fence in inode_do_switch_wbs() and 281 281 * ensures that we see the new wb if we see cleared I_WB_SWITCH. 282 282 */ 283 - cookie->locked = smp_load_acquire(&inode->i_state) & I_WB_SWITCH; 283 + cookie->locked = inode->i_state & I_WB_SWITCH; 284 + smp_rmb(); 284 285 285 286 if (unlikely(cookie->locked)) 286 287 xa_lock_irqsave(&inode->i_mapping->i_pages, cookie->flags);