)]}'
{
  "commit": "962c167b0f262b9962207fbeaa531721d55ea00e",
  "tree": "af6d4a87275cce83604335cfb84e9dee8ee2648d",
  "parents": [
    "cf4a9e1bc8129eb63fda5f8bdcd8d87f0bd76f42"
  ],
  "author": {
    "name": "Yongpeng Yang",
    "email": "yangyongpeng@xiaomi.com",
    "time": "Tue Feb 17 10:19:06 2026 -0500"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Thu Feb 19 16:29:56 2026 +0100"
  },
  "message": "f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes\n\n[ Upstream commit 7633a7387eb4d0259d6bea945e1d3469cd135bbc ]\n\nDuring SPO tests, when mounting F2FS, an -EINVAL error was returned from\nf2fs_recover_inode_page. The issue occurred under the following scenario\n\nThread A                                     Thread B\nf2fs_ioc_commit_atomic_write\n - f2fs_do_sync_file // atomic \u003d true\n  - f2fs_fsync_node_pages\n    : last_folio \u003d inode folio\n    : schedule before folio_lock(last_folio) f2fs_write_checkpoint\n                                              - block_operations// writeback last_folio\n                                              - schedule before f2fs_flush_nat_entries\n    : set_fsync_mark(last_folio, 1)\n    : set_dentry_mark(last_folio, 1)\n    : folio_mark_dirty(last_folio)\n    - __write_node_folio(last_folio)\n      : f2fs_down_read(\u0026sbi-\u003enode_write)//block\n                                              - f2fs_flush_nat_entries\n                                                : {struct nat_entry}-\u003eflag |\u003d BIT(IS_CHECKPOINTED)\n                                              - unblock_operations\n                                                : f2fs_up_write(\u0026sbi-\u003enode_write)\n                                             f2fs_write_checkpoint//return\n      : f2fs_do_write_node_page()\nf2fs_ioc_commit_atomic_write//return\n                                             SPO\n\nThread A calls f2fs_need_dentry_mark(sbi, ino), and the last_folio has\nalready been written once. However, the {struct nat_entry}-\u003eflag did not\nhave the IS_CHECKPOINTED set, causing set_dentry_mark(last_folio, 1) and\nwrite last_folio again after Thread B finishes f2fs_write_checkpoint.\n\nAfter SPO and reboot, it was detected that {struct node_info}-\u003eblk_addr\nwas not NULL_ADDR because Thread B successfully write the checkpoint.\n\nThis issue only occurs in atomic write scenarios. For regular file\nfsync operations, the folio must be dirty. If\nblock_operations-\u003ef2fs_sync_node_pages successfully submit the folio\nwrite, this path will not be executed. Otherwise, the\nf2fs_write_checkpoint will need to wait for the folio write submission\nto complete, as sbi-\u003enr_pages[F2FS_DIRTY_NODES] \u003e 0. Therefore, the\nsituation where f2fs_need_dentry_mark checks that the {struct\nnat_entry}-\u003eflag /wo the IS_CHECKPOINTED flag, but the folio write has\nalready been submitted, will not occur.\n\nTherefore, for atomic file fsync, sbi-\u003enode_write should be acquired\nthrough __write_node_folio to ensure that the IS_CHECKPOINTED flag\ncorrectly indicates that the checkpoint write has been completed.\n\nFixes: 608514deba38 (\"f2fs: set fsync mark only for the last dnode\")\nCc: stable@kernel.org\nSigned-off-by: Sheng Yong \u003cshengyong1@xiaomi.com\u003e\nSigned-off-by: Jinbao Liu \u003cliujinbao1@xiaomi.com\u003e\nSigned-off-by: Yongpeng Yang \u003cyangyongpeng@xiaomi.com\u003e\nReviewed-by: Chao Yu \u003cchao@kernel.org\u003e\nSigned-off-by: Jaegeuk Kim \u003cjaegeuk@kernel.org\u003e\n[ folio \u003d\u003e page ]\nSigned-off-by: Sasha Levin \u003csashal@kernel.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "720768d574ae6e7cd2f2a695e2d9f3134f17ef82",
      "old_mode": 33188,
      "old_path": "fs/f2fs/node.c",
      "new_id": "1f4f68e56d432fdc0f3cc63dcbb9d526d3c5fd5a",
      "new_mode": 33188,
      "new_path": "fs/f2fs/node.c"
    }
  ]
}
