)]}'
{
  "commit": "6e7188a8d725decabde50e86561a641b4600188b",
  "tree": "9511325c36b35a8dad2fa90355c959e8ff8f23a2",
  "parents": [
    "254f49634ee16a731174d2ae34bc50bd5f45e731"
  ],
  "author": {
    "name": "Gao Xiang",
    "email": "hsiangkao@linux.alibaba.com",
    "time": "Tue Apr 28 12:34:31 2026 +0800"
  },
  "committer": {
    "name": "Gao Xiang",
    "email": "hsiangkao@linux.alibaba.com",
    "time": "Tue Apr 28 13:59:18 2026 +0800"
  },
  "message": "erofs: fix managed cache race for unaligned extents\n\nAfter unaligned compressed extents were introduced, the following race\ncould occur:\n\n[Thread 1]                                   [Thread 2]\n(z_erofs_fill_bio_vec)\n\u003chandle a Z_EROFS_PREALLOCATED_FOLIO folio\u003e\n...\nfilemap_add_folio (1)\n                                             (z_erofs_bind_cache)\n                                             \u003cthe same folio is found..\u003e\n                                             ..\n                                             ..\nfolio_attach_private (2)\n                                             filemap_add_folio (3) again\n\nSince (1) is executed but (2) hasn\u0027t been executed yet, it\u0027s possible\nthat another thread finds the same managed folio in z_erofs_bind_cache()\nfor a different pcluster and calls filemap_add_folio() again since\nfolio-\u003eprivate is still Z_EROFS_PREALLOCATED_FOLIO.\n\nFix this by explicitly clearing folio-\u003eprivate before making the folio\nvisible in the managed cache so that another pcluster can simply wait\non the locked managed folio as what we did for other shared cases [1].\n\nThis only impacts unaligned data compression (`-E48bit` with zstd,\nfor example).\n\n[1] Commit 9e2f9d34dd12 (\"erofs: handle overlapped pclusters out of\n crafted images properly\") was originally introduced to handle crafted\n overlapped extents, but it addresses unaligned extents as well.\n\nFixes: 7361d1e3763b (\"erofs: support unaligned encoded data\")\nReported-by: Arseniy Krasnov \u003cavkrasnov@salutedevices.com\u003e\nCloses: https://lore.kernel.org/r/4a2f3801-fac1-42fe-ae75-da315822e088@salutedevices.com\nSigned-off-by: Gao Xiang \u003chsiangkao@linux.alibaba.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "43bb5a6a9924b3f9997f23f4be48e4dbd7dd59a3",
      "old_mode": 33188,
      "old_path": "fs/erofs/zdata.c",
      "new_id": "27ab7bd844ec7837b9d0cf80e5911e5ad9faeaa2",
      "new_mode": 33188,
      "new_path": "fs/erofs/zdata.c"
    }
  ]
}
