)]}'
{
  "commit": "fd106ada4dee4b8adefec791ee9b9681b7b77501",
  "tree": "2f248cf9713cbc0ccb08fa74be0e070eb6edd578",
  "parents": [
    "74bbd6ada01f91fcad60608e0417bf45a9fa99e6"
  ],
  "author": {
    "name": "Chao Yu",
    "email": "chao@kernel.org",
    "time": "Mon Oct 19 09:00:32 2026 +0000"
  },
  "committer": {
    "name": "Jaegeuk Kim",
    "email": "jaegeuk@kernel.org",
    "time": "Tue Oct 20 15:18:36 2026 +0000"
  },
  "message": "f2fs: zone: fix to don\u0027t fail to grab GC target block on zoned device\n\nWith out-of-memory fault injection (inject_type\u003d0x0080800f) on a zoned\ndevice, f2fs stopped checkpoint during GC:\n\n F2FS-fs (dm-0): inject kmalloc in f2fs_kmalloc of move_data_block+0xc0b/0x12b0\n Workqueue: dm-1_zwplugs blk_zone_wplug_bio_work\n Call Trace:\n  \u003cTASK\u003e\n  dump_stack_lvl+0x4d/0x70\n  f2fs_stop_checkpoint+0x1df/0x5d0\n  f2fs_write_end_bio+0xdbb/0x1320\n  blk_zone_wplug_bio_work+0x2aa/0x7d0\n  process_one_work+0x5c6/0xde0\n  worker_thread+0x403/0xb70\n  kthread+0x235/0x2e0\n  ret_from_fork+0x2f/0x70\n  ret_from_fork_asm+0x1a/0x30\n  \u003c/TASK\u003e\n F2FS-fs (dm-0): Stopped filesystem due to reason: 3\n\nIn move_data_block(), the target block is grabbed from the meta cache\nafter f2fs_allocate_data_block() has allocated newaddr. If grabbing it\nfails w/ -ENOMEM, recover_block calls f2fs_do_replace_block() to restore\nthe old block address and curseg\u0027s next_blkoff, which already points\npast newaddr, so newaddr is never written. That leaves a hole in a\nsequential zone: the next write to the zone is not at the write pointer,\nthe zone write plug fails it, and f2fs_write_end_bio() stops checkpoint\nw/ STOP_CP_REASON_WRITE_FAIL.\n\nmove_data_block() allocates newaddr before grabbing its meta page and\ngoes to recover_block if the grab fails since commit 4356e48e6437\n(\"f2fs crypto: fix incorrect positioning for GCing encrypted data page\"),\nthe meta cache only replaced the meta page w/ a meta cache entry. That\nis harmless on a regular device, but it leaves the hole since f2fs\nsupports host-managed SMR (now zoned block) devices, which only accept\nwrites at the write pointer of a sequential zone.\n\nIf newaddr is in a sequential zone, grab the target block w/\nF2FS_CACHE_NOFAIL, so nothing can fail between allocating newaddr and\nwriting it. In a conventional zone or on a regular device, skipping\nnewaddr is harmless, so keep the error handling for them.\n\nCc: stable@kernel.org\nFixes: 52763a4b7a21 (\"f2fs: detect host-managed SMR by feature flag\")\nFixes: d1b959c87702 (\"f2fs: Check zoned block feature for host-managed zoned block devices\")\nSigned-off-by: Chao Yu \u003cchao@kernel.org\u003e\nSigned-off-by: Jaegeuk Kim \u003cjaegeuk@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "18aa6a12e805db8025dd020bb67ca8e50e4dcb0e",
      "old_mode": 33188,
      "old_path": "fs/f2fs/gc.c",
      "new_id": "5b948c92f98137d94c638d787d063d8410e24c21",
      "new_mode": 33188,
      "new_path": "fs/f2fs/gc.c"
    }
  ]
}
