summaryrefslogtreecommitdiff
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@gmail.com>2024-06-10 19:00:29 +0300
committerAndrew Morton <akpm@linux-foundation.org>2024-06-25 08:25:09 +0300
commit68142cb628f75a22f12fde9f5c0c69dfc1bdcf47 (patch)
tree6d7e95b98ddda3068c5484defe081e30168de524 /fs/nilfs2
parent25fa5f9923383784bbf2423ccc84f75615e4b12d (diff)
downloadlinux-68142cb628f75a22f12fde9f5c0c69dfc1bdcf47.tar.xz
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>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/segment.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index a92609816bc9..36e0bb38e1aa 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1678,6 +1678,7 @@ static void nilfs_prepare_write_logs(struct list_head *logs, u32 seed)
list_for_each_entry(segbuf, logs, sb_list) {
list_for_each_entry(bh, &segbuf->sb_segsum_buffers,
b_assoc_buffers) {
+ mark_buffer_dirty(bh);
if (bh->b_folio == bd_folio)
continue;
if (bd_folio) {
@@ -1694,6 +1695,7 @@ static void nilfs_prepare_write_logs(struct list_head *logs, u32 seed)
/* Prepare to write super root block */
bh = NILFS_LAST_SEGBUF(logs)->sb_super_root;
if (bh) {
+ mark_buffer_dirty(bh);
if (bh->b_folio != bd_folio) {
folio_lock(bd_folio);
folio_wait_writeback(bd_folio);
@@ -2843,8 +2845,6 @@ int nilfs_attach_log_writer(struct super_block *sb, struct nilfs_root *root)
if (!nilfs->ns_writer)
return -ENOMEM;
- inode_attach_wb(nilfs->ns_bdev->bd_mapping->host, NULL);
-
err = nilfs_segctor_start_thread(nilfs->ns_writer);
if (unlikely(err))
nilfs_detach_log_writer(sb);