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.

nilfs2: do not call inode_attach_wb() directly

Call mark_buffer_dirty() for segment summary and super root block buffers
on the backing device's page cache, thereby indirectly calling
inode_attach_wb().

Then remove the no longer needed call to inode_attach_wb() in
nilfs_attach_log_writer(), resolving the concern about its layer-violating
use.

Link: https://lkml.kernel.org/r/20240610160029.7673-3-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Ryusuke Konishi and committed by
Andrew Morton
68142cb6 25fa5f99

+2 -2
+2 -2
fs/nilfs2/segment.c
··· 1678 1678 list_for_each_entry(segbuf, logs, sb_list) { 1679 1679 list_for_each_entry(bh, &segbuf->sb_segsum_buffers, 1680 1680 b_assoc_buffers) { 1681 + mark_buffer_dirty(bh); 1681 1682 if (bh->b_folio == bd_folio) 1682 1683 continue; 1683 1684 if (bd_folio) { ··· 1695 1694 /* Prepare to write super root block */ 1696 1695 bh = NILFS_LAST_SEGBUF(logs)->sb_super_root; 1697 1696 if (bh) { 1697 + mark_buffer_dirty(bh); 1698 1698 if (bh->b_folio != bd_folio) { 1699 1699 folio_lock(bd_folio); 1700 1700 folio_wait_writeback(bd_folio); ··· 2844 2842 nilfs->ns_writer = nilfs_segctor_new(sb, root); 2845 2843 if (!nilfs->ns_writer) 2846 2844 return -ENOMEM; 2847 - 2848 - inode_attach_wb(nilfs->ns_bdev->bd_mapping->host, NULL); 2849 2845 2850 2846 err = nilfs_segctor_start_thread(nilfs->ns_writer); 2851 2847 if (unlikely(err))