)]}'
{
  "commit": "91f4ab056d85d23fa6955927fdeb1558673e8cd1",
  "tree": "95745578b92f329b3fbe7761baf8c422b2975473",
  "parents": [
    "bce61dd49d6ba7799be2de17c772e4c701558f14"
  ],
  "author": {
    "name": "Hirokazu Takata",
    "email": "takata@linux-m32r.org",
    "time": "Mon Nov 28 13:43:58 2005 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Mon Nov 28 14:42:24 2005 -0800"
  },
  "message": "[PATCH] m32r: Fix sys_tas() syscall\n\nThis patch fixes a deadlock problem of the m32r SMP kernel.\n\nIn the m32r kernel, sys_tas() system call is provided as a test-and-set\nfunction for userspace, for backward compatibility.\n\nIn some multi-threading application program, deadlocks were rarely caused\nat sys_tas() funcion.  Such a deadlock was caused due to a collision of\n__pthread_lock() and __pthread_unlock() operations.\n\nThe \"tas\" syscall is repeatedly called by pthread_mutex_lock() to get a\nlock, while a lock variable\u0027s value is not 0.  On the other hand,\npthead_mutex_unlock() sets the lock variable to 0 for unlocking.\n\nIn the previous implementation of sys_tas() routine, there was a\npossibility that a unlock operation was ignored in the following case:\n\n- Assume a lock variable (*addr) was equal to 1 before sys_tas() execution.\n- __pthread_unlock() operation is executed by the other processor\n  and the lock variable (*addr) is set to 0, between a read operation\n  (\"oldval \u003d *addr;\") and the following write operation (\"*addr \u003d 1;\")\n  during a execution of sys_tas().\n\nIn this case, the following write operation (\"*addr \u003d 1;\") overwrites the\n__pthread_unlock() result, and sys_tas() fails to get a lock in the next\nturn and after that.\n\nAccording to the attatched patch, sys_tas() returns 0 value in the next\nturn and deadlocks never happen.\n\nSigned-off-by: Hitoshi Yamamoto \u003cYamamoto.Hitoshi@ap.MitsubishiElectric.co.jp\u003e\nSigned-off-by: Hirokazu Takata \u003ctakata@linux-m32r.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e0500e12c5fbbb934c7debc9dc84dd1d7d1300dc",
      "old_mode": 33188,
      "old_path": "arch/m32r/kernel/sys_m32r.c",
      "new_id": "fe55b28d3725b48ed48e5fcdab52902592aa2d4e",
      "new_mode": 33188,
      "new_path": "arch/m32r/kernel/sys_m32r.c"
    }
  ]
}
