hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/fs/f2fs/data.c
....@@ -698,7 +698,7 @@
698698 }
699699
700700 if (fio->io_wbc && !is_read_io(fio->op))
701
- wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE);
701
+ wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE);
702702
703703 __attach_io_flag(fio);
704704 bio_set_op_attrs(bio, fio->op, fio->op_flags);
....@@ -829,6 +829,8 @@
829829 bool found = false;
830830 struct bio *target = bio ? *bio : NULL;
831831
832
+ f2fs_bug_on(sbi, !target && !page);
833
+
832834 for (temp = HOT; temp < NR_TEMP_TYPE && !found; temp++) {
833835 struct f2fs_bio_info *io = sbi->write_io[DATA] + temp;
834836 struct list_head *head = &io->bio_list;
....@@ -908,7 +910,7 @@
908910 }
909911
910912 if (fio->io_wbc)
911
- wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE);
913
+ wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE);
912914
913915 inc_page_count(fio->sbi, WB_DATA_TYPE(page));
914916
....@@ -982,7 +984,7 @@
982984 }
983985
984986 if (fio->io_wbc)
985
- wbc_account_cgroup_owner(fio->io_wbc, bio_page, PAGE_SIZE);
987
+ wbc_account_cgroup_owner(fio->io_wbc, fio->page, PAGE_SIZE);
986988
987989 io->last_block_in_bio = fio->new_blkaddr;
988990
....@@ -2770,7 +2772,8 @@
27702772 * don't drop any dirty dentry pages for keeping lastest
27712773 * directory structure.
27722774 */
2773
- if (S_ISDIR(inode->i_mode))
2775
+ if (S_ISDIR(inode->i_mode) &&
2776
+ !is_sbi_flag_set(sbi, SBI_IS_CLOSE))
27742777 goto redirty_out;
27752778 goto out;
27762779 }
....@@ -2875,7 +2878,8 @@
28752878
28762879 if (unlikely(f2fs_cp_error(sbi))) {
28772880 f2fs_submit_merged_write(sbi, DATA);
2878
- f2fs_submit_merged_ipu_write(sbi, bio, NULL);
2881
+ if (bio && *bio)
2882
+ f2fs_submit_merged_ipu_write(sbi, bio, NULL);
28792883 submitted = NULL;
28802884 }
28812885