)]}'
{
  "commit": "ee731f4f7880b09ca147008ab46ad4e5f72cb8bf",
  "tree": "a61545ec0a04c7699727dc9e5c5c9a30b1d75ab0",
  "parents": [
    "7bbab9166a82d15442357cfd63ec530b5b5fb62e"
  ],
  "author": {
    "name": "Ernie Petrides",
    "email": "petrides@redhat.com",
    "time": "Fri Sep 29 02:00:13 2006 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Fri Sep 29 09:18:13 2006 -0700"
  },
  "message": "[PATCH] fix wrong error code on interrupted close syscalls\n\nThe problem is that close() syscalls can call a file system\u0027s flush\nhandler, which in turn might sleep interruptibly and ultimately pass back\nan -ERESTARTSYS return value.  This happens for files backed by an\ninterruptible NFS mount under nfs_file_flush() when a large file has just\nbeen written and nfs_wait_bit_interruptible() detects that there is a\nsignal pending.\n\nI have a test case where the \"strace\" command is used to attach to a\nprocess sleeping in such a close().  Since the SIGSTOP is forced onto the\nvictim process (removing it from the thread\u0027s \"blocked\" mask in\nforce_sig_info()), the RPC wait is interrupted and the close() is\nterminated early.\n\nBut the file table entry has already been cleared before the flush handler\nwas called.  Thus, when the syscall is restarted, the file descriptor\nappears closed and an EBADF error is returned (which is wrong).  What\u0027s\nworse, there is the hypothetical case where another thread of a\nmulti-threaded application might have reused the file descriptor, in which\ncase that file would be mistakenly closed.\n\nThe bottom line is that close() syscalls are not restartable, and thus\n-ERESTARTSYS return values should be mapped to -EINTR.  This is consistent\nwith the close(2) manual page.  The fix is below.\n\nSigned-off-by: Ernie Petrides \u003cpetrides@redhat.com\u003e\nCc: Roland McGrath \u003croland@redhat.com\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": "1574d8fe4909de63baf93d6129ace8a2f990a94c",
      "old_mode": 33188,
      "old_path": "fs/open.c",
      "new_id": "304c1c7814cbacfec0695e8714c5557ea8ee0e9b",
      "new_mode": 33188,
      "new_path": "fs/open.c"
    }
  ]
}
