)]}'
{
  "commit": "9f5418010940236b2c39ea53b99055ca26ff1279",
  "tree": "5ef0501c5431567c3c47eb6f2ea1bbfd1311390b",
  "parents": [
    "fe742fd4f90fa53cf31296bc5131ae1cdd6d84bb"
  ],
  "author": {
    "name": "Dave Chinner",
    "email": "david@fromorbit.com",
    "time": "Thu May 19 00:17:26 2016 +1000"
  },
  "committer": {
    "name": "Al Viro",
    "email": "viro@zeniv.linux.org.uk",
    "time": "Wed May 18 13:20:21 2016 -0400"
  },
  "message": "xfs: concurrent readdir hangs on data buffer locks\n\nThere\u0027s a three-process deadlock involving shared/exclusive barriers\nand inverted lock orders in the directory readdir implementation.\nIt\u0027s a pre-existing problem with lock ordering, exposed by the\nVFS parallelisation code.\n\nprocess 1               process 2               process 3\n---------               ---------               ---------\nreaddir\niolock(shared)\n  get_leaf_dents\n    iterate entries\n       ilock(shared)\n       map, lock and read buffer\n       iunlock(shared)\n       process entries in buffer\n       .....\n                                                readdir\n                                                iolock(shared)\n                                                  get_leaf_dents\n                                                    iterate entries\n                                                      ilock(shared)\n                                                      map, lock buffer\n                                                      \u003cblocks\u003e\n                        finish -\u003eiterate_shared\n                        file_accessed()\n                          -\u003eupdate_time\n                            start transaction\n                            ilock(excl)\n                            \u003cblocks\u003e\n        .....\n        finishes processing buffer\n        get next buffer\n          ilock(shared)\n          \u003cblocks\u003e\n\nAnd that\u0027s the deadlock.\n\nFix this by dropping the current buffer lock in process 1 before\ntrying to map the next buffer. This means we keep the lock order of\nilock -\u003e buffer lock intact and hence will allow process 3 to make\nprogress and drop it\u0027s ilock(shared) once it is done.\n\nReported-by: Xiong Zhou \u003cxzhou@redhat.com\u003e\nSigned-off-by: Dave Chinner \u003cdchinner@redhat.com\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "93b3ab0c54350fbdd6e977e787d6b7c3911b792d",
      "old_mode": 33188,
      "old_path": "fs/xfs/xfs_dir2_readdir.c",
      "new_id": "f44f7999697860ace70a6de316f81e76dee5bc08",
      "new_mode": 33188,
      "new_path": "fs/xfs/xfs_dir2_readdir.c"
    }
  ]
}
