)]}'
{
  "commit": "24c7cd0630f76f0eb081d539c53893d9f15787e8",
  "tree": "a77af55cf9dd3b40f38d1822817babe1226849af",
  "parents": [
    "b043b673dc8a73daa233d5d92cf70b32e7351314"
  ],
  "author": {
    "name": "Stefan Richter",
    "email": "stefanr@s5r6.in-berlin.de",
    "time": "Sat Apr 01 21:11:41 2006 +0200"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Sun Apr 02 12:58:09 2006 -0700"
  },
  "message": "[PATCH] sbp2: fix spinlock recursion\n\nsbp2util_mark_command_completed takes a lock which was already taken by\nsbp2scsi_complete_all_commands.  This is a regression in Linux 2.6.15.\n\n Reported by Kristian Harms at\n\thttps://bugzilla.redhat.com/bugzilla/show_bug.cgi?id\u003d187394\n\n[ More complete commentary, as response to questions by Andrew: ]\n\n\u003e This changes the call environment for all implementations of\n\u003e -\u003eCurrent_done().  Are they all safe to call under this lock?\n\nShort answer: Yes, trust me.  ;-) Long answer:\n\nThe done() callbacks are passed on to sbp2 from the SCSI stack along\nwith each SCSI command via the queuecommand hook.  The done() callback\nis safe to call in atomic context.  So does\nDocumentation/scsi/scsi_mid_low_api.txt say, and many if not all SCSI\nlow-level handlers rely on this fact.  So whatever this callback does,\nit is \"self-contained\" and it won\u0027t conflict with sbp2\u0027s internal ORB\nlist handling.  In particular, it won\u0027t race with the\nsbp2_command_orb_lock.\n\nMoreover, sbp2 already calls the done() handler with\nsbp2_command_orb_lock taken in sbp2scsi_complete_all_commands().  I\nadmit this is ultimately no proof of correctness, especially since this\nportion of code introduced the spinlock recursion in the first place and\nwe didn\u0027t realize it since this code\u0027s submission before 2.6.15 until\nnow.  (I have learned a lesson from this.)\n\nI stress-tested my patch on x86 uniprocessor with a preemptible SMP\nkernel (alas I have no SMP machine yet) and made sure that all code\npaths which involve the sbp2_command_orb_lock were gone through multiple\ntimes.\n\nSigned-off-by: Stefan Richter \u003cstefanr@s5r6.in-berlin.de\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2c765ca5aa5065a391fdbbf68b47ae9461a02470",
      "old_mode": 33188,
      "old_path": "drivers/ieee1394/sbp2.c",
      "new_id": "f4206604db0378fb33fda046cb403f4a346cdb45",
      "new_mode": 33188,
      "new_path": "drivers/ieee1394/sbp2.c"
    }
  ]
}
