)]}'
{
  "commit": "4d0c5ba2ff79ef9f5188998b29fd28fcb05f3667",
  "tree": "3e33b719b0057f9d1364af0e8629d16a64cf05b7",
  "parents": [
    "7b1742eb06ead6d02a6cf3c44587088e5392d1aa"
  ],
  "author": {
    "name": "Miklos Szeredi",
    "email": "mszeredi@redhat.com",
    "time": "Fri Sep 16 12:44:21 2016 +0200"
  },
  "committer": {
    "name": "Miklos Szeredi",
    "email": "mszeredi@redhat.com",
    "time": "Fri Sep 16 12:44:21 2016 +0200"
  },
  "message": "vfs: do get_write_access() on upper layer of overlayfs\n\nThe problem with writecount is: we want consistent handling of it for\nunderlying filesystems as well as overlayfs.  Making sure i_writecount is\ncorrect on all layers is difficult.  Instead this patch makes sure that\nwhen write access is acquired, it\u0027s always done on the underlying writable\nlayer (called the upper layer).  We must also make sure to look at the\nwritecount on this layer when checking for conflicting leases.\n\nOpen for write already updates the upper layer\u0027s writecount.  Leaving only\ntruncate.\n\nFor truncate copy up must happen before get_write_access() so that the\nwritecount is updated on the upper layer.  Problem with this is if\nsomething fails after that, then copy-up was done needlessly.  E.g. if\nbreak_lease() was interrupted.  Probably not a big deal in practice.\n\nAnother interesting case is if there\u0027s a denywrite on a lower file that is\nthen opened for write or truncated.  With this patch these will succeed,\nwhich is somewhat counterintuitive.  But I think it\u0027s still acceptable,\nconsidering that the copy-up does actually create a different file, so the\nold, denywrite mapping won\u0027t be touched.\n\nOn non-overlayfs d_real() is an identity function and d_real_inode() is\nequivalent to d_inode() so this patch doesn\u0027t change behavior in that case.\n\nSigned-off-by: Miklos Szeredi \u003cmszeredi@redhat.com\u003e\nAcked-by: Jeff Layton \u003cjlayton@poochiereds.net\u003e\nCc: \"J. Bruce Fields\" \u003cbfields@fieldses.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c1656cff53eeb0f3a884e038c0b800b313b6941a",
      "old_mode": 33188,
      "old_path": "fs/locks.c",
      "new_id": "b242d5b9958929a303a8851f7d5094833ee6db88",
      "new_mode": 33188,
      "new_path": "fs/locks.c"
    },
    {
      "type": "modify",
      "old_id": "648fb9d3e97a55acffe2e1ed25efe1014537ed1e",
      "old_mode": 33188,
      "old_path": "fs/open.c",
      "new_id": "8aeb08bb278bd92978a823ec63a2c9593bfe7460",
      "new_mode": 33188,
      "new_path": "fs/open.c"
    }
  ]
}
