)]}'
{
  "commit": "3b5bac2bdea1de832bdd8e2c904ab7c9479ff9ed",
  "tree": "b7e9fbdfa42e2e053c33af1b533a4e3693a352fe",
  "parents": [
    "f2f009812f1fdcaf40fa547282c1b90d3b702a7d"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Wed Aug 04 02:34:17 2010 +0000"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Wed Aug 04 21:53:16 2010 -0700"
  },
  "message": "RxRPC: Fix a potential deadlock between the call resend_timer and state_lock\n\nRxRPC can potentially deadlock as rxrpc_resend_time_expired() wants to get\ncall-\u003estate_lock so that it can alter the state of an RxRPC call.  However, its\ncaller (call_timer_fn()) has an apparent lock on the timer struct.\n\nThe problem is that rxrpc_resend_time_expired() isn\u0027t permitted to lock\ncall-\u003estate_lock as this could cause a deadlock against rxrpc_send_abort() as\nthat takes state_lock and then attempts to delete the resend timer by calling\ndel_timer_sync().\n\nThe deadlock can occur because del_timer_sync() will sit there forever waiting\nfor rxrpc_resend_time_expired() to return, but the latter may then wait for\ncall-\u003estate_lock, which rxrpc_send_abort() holds around del_timer_sync()...\n\nThis leads to a warning appearing in the kernel log that looks something like\nthe attached.\n\nIt should be sufficient to simply dispense with the locks.  It doesn\u0027t matter\nif we set the resend timer expired event bit and queue the event processor\nwhilst we\u0027re changing state to one where the resend timer is irrelevant as the\nevent can just be ignored by the processor thereafter.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n[ INFO: possible circular locking dependency detected ]\n2.6.35-rc3-cachefs+ #115\n-------------------------------------------------------\nswapper/0 is trying to acquire lock:\n (\u0026call-\u003estate_lock){++--..}, at: [\u003cffffffffa00200d4\u003e] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]\n\nbut task is already holding lock:\n (\u0026call-\u003eresend_timer){+.-...}, at: [\u003cffffffff8103b675\u003e] run_timer_softirq+0x182/0x2a5\n\nwhich lock already depends on the new lock.\n\nthe existing dependency chain (in reverse order) is:\n\n-\u003e #1 (\u0026call-\u003eresend_timer){+.-...}:\n       [\u003cffffffff810560bc\u003e] __lock_acquire+0x889/0x8fa\n       [\u003cffffffff81056184\u003e] lock_acquire+0x57/0x6d\n       [\u003cffffffff8103bb9c\u003e] del_timer_sync+0x3c/0x86\n       [\u003cffffffffa002bb7a\u003e] rxrpc_send_abort+0x50/0x97 [af_rxrpc]\n       [\u003cffffffffa002bdd9\u003e] rxrpc_kernel_abort_call+0xa1/0xdd [af_rxrpc]\n       [\u003cffffffffa0061588\u003e] afs_deliver_to_call+0x129/0x368 [kafs]\n       [\u003cffffffffa006181b\u003e] afs_process_async_call+0x54/0xff [kafs]\n       [\u003cffffffff8104261d\u003e] worker_thread+0x1ef/0x2e2\n       [\u003cffffffff81045f47\u003e] kthread+0x7a/0x82\n       [\u003cffffffff81002cd4\u003e] kernel_thread_helper+0x4/0x10\n\n-\u003e #0 (\u0026call-\u003estate_lock){++--..}:\n       [\u003cffffffff81055237\u003e] validate_chain+0x727/0xd23\n       [\u003cffffffff810560bc\u003e] __lock_acquire+0x889/0x8fa\n       [\u003cffffffff81056184\u003e] lock_acquire+0x57/0x6d\n       [\u003cffffffff813e6b69\u003e] _raw_read_lock_bh+0x34/0x43\n       [\u003cffffffffa00200d4\u003e] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]\n       [\u003cffffffff8103b6e6\u003e] run_timer_softirq+0x1f3/0x2a5\n       [\u003cffffffff81036828\u003e] __do_softirq+0xa2/0x13e\n       [\u003cffffffff81002dcc\u003e] call_softirq+0x1c/0x28\n       [\u003cffffffff810049f0\u003e] do_softirq+0x38/0x80\n       [\u003cffffffff810361a2\u003e] irq_exit+0x45/0x47\n       [\u003cffffffff81018fb3\u003e] smp_apic_timer_interrupt+0x88/0x96\n       [\u003cffffffff81002893\u003e] apic_timer_interrupt+0x13/0x20\n       [\u003cffffffff810011ac\u003e] cpu_idle+0x4d/0x83\n       [\u003cffffffff813e06f3\u003e] start_secondary+0x1bd/0x1c1\n\nother info that might help us debug this:\n\n1 lock held by swapper/0:\n #0:  (\u0026call-\u003eresend_timer){+.-...}, at: [\u003cffffffff8103b675\u003e] run_timer_softirq+0x182/0x2a5\n\nstack backtrace:\nPid: 0, comm: swapper Not tainted 2.6.35-rc3-cachefs+ #115\nCall Trace:\n \u003cIRQ\u003e  [\u003cffffffff81054414\u003e] print_circular_bug+0xae/0xbd\n [\u003cffffffff81055237\u003e] validate_chain+0x727/0xd23\n [\u003cffffffff810560bc\u003e] __lock_acquire+0x889/0x8fa\n [\u003cffffffff810539a7\u003e] ? mark_lock+0x42f/0x51f\n [\u003cffffffff81056184\u003e] lock_acquire+0x57/0x6d\n [\u003cffffffffa00200d4\u003e] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]\n [\u003cffffffff813e6b69\u003e] _raw_read_lock_bh+0x34/0x43\n [\u003cffffffffa00200d4\u003e] ? rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]\n [\u003cffffffffa00200d4\u003e] rxrpc_resend_time_expired+0x56/0x96 [af_rxrpc]\n [\u003cffffffff8103b6e6\u003e] run_timer_softirq+0x1f3/0x2a5\n [\u003cffffffff8103b675\u003e] ? run_timer_softirq+0x182/0x2a5\n [\u003cffffffffa002007e\u003e] ? rxrpc_resend_time_expired+0x0/0x96 [af_rxrpc]\n [\u003cffffffff810367ef\u003e] ? __do_softirq+0x69/0x13e\n [\u003cffffffff81036828\u003e] __do_softirq+0xa2/0x13e\n [\u003cffffffff81002dcc\u003e] call_softirq+0x1c/0x28\n [\u003cffffffff810049f0\u003e] do_softirq+0x38/0x80\n [\u003cffffffff810361a2\u003e] irq_exit+0x45/0x47\n [\u003cffffffff81018fb3\u003e] smp_apic_timer_interrupt+0x88/0x96\n [\u003cffffffff81002893\u003e] apic_timer_interrupt+0x13/0x20\n \u003cEOI\u003e  [\u003cffffffff81049de1\u003e] ? __atomic_notifier_call_chain+0x0/0x86\n [\u003cffffffff8100955b\u003e] ? mwait_idle+0x6e/0x78\n [\u003cffffffff81009552\u003e] ? mwait_idle+0x65/0x78\n [\u003cffffffff810011ac\u003e] cpu_idle+0x4d/0x83\n [\u003cffffffff813e06f3\u003e] start_secondary+0x1bd/0x1c1\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2714da167fb8980fd7a43f3485e25e2bdcfc7feb",
      "old_mode": 33188,
      "old_path": "net/rxrpc/ar-ack.c",
      "new_id": "b6ffe4e1b84afa8a12205bf0bc00ff424341c2c0",
      "new_mode": 33188,
      "new_path": "net/rxrpc/ar-ack.c"
    },
    {
      "type": "modify",
      "old_id": "909d092de9f43c9e4320e465711d2d1a36fb692a",
      "old_mode": 33188,
      "old_path": "net/rxrpc/ar-call.c",
      "new_id": "bf656c230ba93e2dee0cf5c17ec403f84f09a4b2",
      "new_mode": 33188,
      "new_path": "net/rxrpc/ar-call.c"
    }
  ]
}
