)]}'
{
  "commit": "d74a054fa4f5a3fc05eae11b3ff0b653b49dd7cb",
  "tree": "b64e48e4e32192d8fc6575d4607330588469f561",
  "parents": [
    "d623a9420c9ae2b748ba458c0e9d59084419fce0"
  ],
  "author": {
    "name": "Sougata Santra",
    "email": "sougata@tuxera.com",
    "time": "Thu Jan 23 15:55:25 2014 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Jan 23 16:37:00 2014 -0800"
  },
  "message": "hfsplus: remove hfsplus_file_lookup()\n\nHFS+ resource fork lookup breaks opendir() library function.  Since\nopendir first calls open() with O_DIRECTORY flag set.  O_DIRECTORY means\n\"refuse to open if not a directory\".  The open system call in the kernel\ndoes a check for inode-\u003ei_op-\u003elookup and returns -ENOTDIR.  So if\nhfsplus_file_lookup is set it allows opendir() for plain files.\n\nAlso resource fork lookup in HFS+ does not work.  Since it is never\ninvoked after VFS permission checking.  It will always return with\n-EACCES.\n\nWhen we call opendir() on a file, it does not return NULL.  opendir()\nlibrary call is based on open with O_DIRECTORY flag passed and then\nlayered on top of getdents() system call.  O_DIRECTORY means \"refuse to\nopen if not a directory\".\n\nThe open() system call in the kernel does a check for: do_sys_open()\n--\u003e..--\u003e can_lookup() i.e it only checks inode-\u003ei_op-\u003elookup and returns\nENOTDIR if this function pointer is not set.\n\nIn OSX, we can open \"file/rsrc\" to get the resource fork of \"file\".  This\nbehavior is emulated inside hfsplus on Linux, which means that to some\ndegree every file acts like a directory.  That is the reason lookup()\ninode operations is supported for files, and it is possible to do a lookup\non this specific name.  As a result of this open succeeds without\nreturning ENOTDIR for HFS+\n\nPlease see the LKML discussion thread on this issue:\nhttp://marc.info/?l\u003dlinux-fsdevel\u0026m\u003d122823343730412\u0026w\u003d2\n\nI tried to test file/rsrc lookup in HFS+ driver and the feature does not\nwork.  From OSX:\n\n$ touch test\n$ echo \"1234\" \u003e test/..namedfork/rsrc\n$ ls -l test..namedfork/rsrc\n--rw-r--r-- 1 tuxera staff 5 10 dec 12:59 test/..namedfork/rsrc\n\n[sougata@ultrabook tmp]$ id\nuid\u003d1000(sougata) gid\u003d1000(sougata) groups\u003d1000(sougata),5(tty),18(dialout),1001(vboxusers)\n\n[sougata@ultrabook tmp]$ mount\n/dev/sdb1 on /mnt/tmp type hfsplus (rw,relatime,umask\u003d0,uid\u003d1000,gid\u003d1000,nls\u003dutf8)\n\n[sougata@ultrabook tmp]$ ls -l test/rsrc\nls: cannot access test/rsrc: Permission denied\n\nAccording to this LKML thread it is expected behavior.\n\nhttp://marc.info/?t\u003d121139033800008\u0026r\u003d1\u0026w\u003d4\n\nI guess now that permission checking happens in vfs generic_permission() ?\n So it turns out that even though the lookup() inode_operation exists for\nHFS+ files.  It cannot really get invoked ?.  So if we can disable this\nfeature to make opendir() work for HFS+.\n\nSigned-off-by: Sougata Santra \u003csougata@tuxera.com\u003e\nAcked-by: Christoph Hellwig \u003chch@lst.de\u003e\nCc: Vyacheslav Dubeyko \u003cslava@dubeyko.com\u003e\nCc: Anton Altaparmakov \u003caia21@cam.ac.uk\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "37213d075f3c5c9f29029b280b093781ddb526ca",
      "old_mode": 33188,
      "old_path": "fs/hfsplus/inode.c",
      "new_id": "3ebda928229cb375486da2a05f15e860b5380fbc",
      "new_mode": 33188,
      "new_path": "fs/hfsplus/inode.c"
    }
  ]
}
