)]}'
{
  "commit": "99a4a90c8e9337e364136393286544e3753673c3",
  "tree": "fa8da0e7badc7334154f0d5b400bf604cf1dac25",
  "parents": [
    "d489cf9a3e88aafc6c9f55c36ff7bbca2c25d54a"
  ],
  "author": {
    "name": "Al Viro",
    "email": "viro@zeniv.linux.org.uk",
    "time": "Thu Mar 12 14:07:27 2020 -0400"
  },
  "committer": {
    "name": "Al Viro",
    "email": "viro@zeniv.linux.org.uk",
    "time": "Thu Apr 02 01:09:31 2020 -0400"
  },
  "message": "lookup_open(): don\u0027t bother with fallbacks to lookup+create\n\nWe fall back to lookup+create (instead of atomic_open) in several cases:\n\t1) we don\u0027t have write access to filesystem and O_TRUNC is\npresent in the flags.  It\u0027s not something we want -\u003eatomic_open() to\nsee - it just might go ahead and truncate the file.  However, we can\npass it the flags sans O_TRUNC - eventually do_open() will call\nhandle_truncate() anyway.\n\t2) we have O_CREAT | O_EXCL and we can\u0027t write to parent.\nThat\u0027s going to be an error, of course, but we want to know _which_\nerror should that be - might be EEXIST (if file exists), might be\nEACCES or EROFS.  Simply stripping O_CREAT (and checking if we see\nENOENT) would suffice, if not for O_EXCL.  However, we used to have\n-\u003eatomic_open() fully responsible for rejecting O_CREAT | O_EXCL\non existing file and just stripping O_CREAT would\u0027ve disarmed\nthose checks.  With nothing downstream to catch the problem -\nFMODE_OPENED used to be \"don\u0027t bother with EEXIST checks,\n-\u003eatomic_open() has done those\".  Now EEXIST checks downstream\nare skipped only if FMODE_CREATED is set - FMODE_OPENED alone\nis not enough.  That has eliminated the need to fall back onto\nlookup+create path in this case.\n\t3) O_WRONLY or O_RDWR when we have no write access to\nfilesystem, with nothing else objectionable.  Fallback is\n(and had always been) pointless.\n\nIOW, we don\u0027t really need that fallback; all we need in such\ncases is to trim O_TRUNC and O_CREAT properly.\n\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1607560f29320590a33c997ac1046f3b3b13453f",
      "old_mode": 33188,
      "old_path": "fs/namei.c",
      "new_id": "61fdb77a7d58a4ffa66dc50471a8cb7394b62566",
      "new_mode": 33188,
      "new_path": "fs/namei.c"
    }
  ]
}
