)]}'
{
  "commit": "386b92953069741a6a583dd4abce71d299fafa55",
  "tree": "875fc8da9b905653182251dd6b659df30af8bf8e",
  "parents": [
    "fa1abce9b7ca80261fe3b097009dd96e5b84f206"
  ],
  "author": {
    "name": "Shin\u0027ichiro Kawasaki",
    "email": "shinichiro.kawasaki@wdc.com",
    "time": "Tue Mar 11 19:43:59 2025 +0900"
  },
  "committer": {
    "name": "Cloud Image Release",
    "email": "cloud-image-release@prod.google.com",
    "time": "Fri Jul 25 15:01:42 2025 -0700"
  },
  "message": "block: change blk_mq_add_to_batch() third argument type to bool\n\n[ Upstream commit 9bce6b5f8987678b9c6c1fe433af6b5fe41feadc ]\n\nConflicts:\n  drivers/block/null_blk/main.c: The end_cmd line in the patch context\n  was replaced with blk_mq_end_request in 8b631f9cf0b8 (null_blk: remove\n  the bio based I/O path). We don\u0027t have that refactor and cherry-picking\n  it would result in many conflicts, so we leave that line as it was.\n  The changed lines in the patch are still identical to the upstream\n  commit. The risk here is also low because we don\u0027t compile null_blk\n  into our kernel (CONFIG_BLK_DEV_NULL_BLK is not set).\n\nCommit 1f47ed294a2b (\"block: cleanup and fix batch completion adding\nconditions\") modified the evaluation criteria for the third argument,\n\u0027ioerror\u0027, in the blk_mq_add_to_batch() function. Initially, the\nfunction had checked if \u0027ioerror\u0027 equals zero. Following the commit, it\nstarted checking for negative error values, with the presumption that\nsuch values, for instance -EIO, would be passed in.\n\nHowever, blk_mq_add_to_batch() callers do not pass negative error\nvalues. Instead, they pass status codes defined in various ways:\n\n- NVMe PCI and Apple drivers pass NVMe status code\n- virtio_blk driver passes the virtblk request header status byte\n- null_blk driver passes blk_status_t\n\nThese codes are either zero or positive, therefore the revised check\nfails to function as intended. Specifically, with the NVMe PCI driver,\nthis modification led to the failure of the blktests test case nvme/039.\nIn this test scenario, errors are artificially injected to the NVMe\ndriver, resulting in positive NVMe status codes passed to\nblk_mq_add_to_batch(), which unexpectedly processes the failed I/O in a\nbatch. Hence the failure.\n\nTo correct the ioerror check within blk_mq_add_to_batch(), make all\ncallers to uniformly pass the argument as boolean. Modify the callers to\ncheck their specific status codes and pass the boolean value \u0027is_error\u0027.\nAlso describe the arguments of blK_mq_add_to_batch as kerneldoc.\n\nBUG\u003db/431080964\nTEST\u003dvalidation, compiled kernel with revert and ran:\n`ITERATIONS\u003d300 KERNEL_TARBALL\u003d$HOME/cos-121/src/third_party/kernel/v6.6/cos-kernel-6.6.97-x86_64.txz bash experimental/users/kpberry/b/431080964/repro.sh`\nRELEASE_NOTE\u003dFixed a kernel bug which caused some NVME disk IO errors to be ignored, potentially resulting in dropped writes.\n\ncos-patch: bug\nFixes: 1f47ed294a2b (\"block: cleanup and fix batch completion adding conditions\")\nSigned-off-by: Shin\u0027ichiro Kawasaki \u003cshinichiro.kawasaki@wdc.com\u003e\nLink: https://lore.kernel.org/r/20250311104359.1767728-3-shinichiro.kawasaki@wdc.com\n[axboe: fold in documentation update]\nSigned-off-by: Jens Axboe \u003caxboe@kernel.dk\u003e\nSigned-off-by: Kevin Berry \u003ckpberry@google.com\u003e\nChange-Id: I5fb6eeece7b383c281255e554946f5ac310baeb7\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/107425\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\nMain-Branch-Verified: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\nReviewed-by: Miri Amarilio \u003cmirilio@google.com\u003e\nReviewed-by: Robert Kolchmeyer \u003crkolchmeyer@google.com\u003e\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/107738\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "97ed3bd9707f418aa765eccf411cb4a0deff4ded",
      "old_mode": 33188,
      "old_path": "drivers/block/null_blk/main.c",
      "new_id": "30384134d0f4e049f741688253e0d9348d15c3f1",
      "new_mode": 33188,
      "new_path": "drivers/block/null_blk/main.c"
    },
    {
      "type": "modify",
      "old_id": "65a1f1576e55fb6c8e679bf393279ae7a2d76af0",
      "old_mode": 33188,
      "old_path": "drivers/block/virtio_blk.c",
      "new_id": "4fe9c9146779f5ab9a9cbb3666c14609222fe0fd",
      "new_mode": 33188,
      "new_path": "drivers/block/virtio_blk.c"
    },
    {
      "type": "modify",
      "old_id": "9b1019ee74789b6fa5cb8ff5bb87dc6e50924057",
      "old_mode": 33188,
      "old_path": "drivers/nvme/host/apple.c",
      "new_id": "a0d5dc5696b2528d6668b7394695f4358b705d24",
      "new_mode": 33188,
      "new_path": "drivers/nvme/host/apple.c"
    },
    {
      "type": "modify",
      "old_id": "97ab91a479d112d1c62f443dad482b9e92d2e081",
      "old_mode": 33188,
      "old_path": "drivers/nvme/host/pci.c",
      "new_id": "6ca0dc7bb7227c8567ab36846ce0dcf5927ca3ac",
      "new_mode": 33188,
      "new_path": "drivers/nvme/host/pci.c"
    },
    {
      "type": "modify",
      "old_id": "1d482c2aabbdfa7d967404ba4121d8129d0927bd",
      "old_mode": 33188,
      "old_path": "include/linux/blk-mq.h",
      "new_id": "fede70671effdb92d5aa4986498f5ef125f8a9a0",
      "new_mode": 33188,
      "new_path": "include/linux/blk-mq.h"
    }
  ]
}
