)]}'
{
  "commit": "9875cf806403fae66b2410a3c2cc820d97731e04",
  "tree": "6f9546b400716766af95e0f78e3d600e765b2b51",
  "parents": [
    "1a8edf40e7c3eee955e0dd0316a7c9d85e36f597"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Fri Jan 14 18:45:21 2011 +0000"
  },
  "committer": {
    "name": "Al Viro",
    "email": "viro@zeniv.linux.org.uk",
    "time": "Sat Jan 15 20:05:03 2011 -0500"
  },
  "message": "Add a dentry op to handle automounting rather than abusing follow_link()\n\nAdd a dentry op (d_automount) to handle automounting directories rather than\nabusing the follow_link() inode operation.  The operation is keyed off a new\ndentry flag (DCACHE_NEED_AUTOMOUNT).\n\nThis also makes it easier to add an AT_ flag to suppress terminal segment\nautomount during pathwalk and removes the need for the kludge code in the\npathwalk algorithm to handle directories with follow_link() semantics.\n\nThe -\u003ed_automount() dentry operation:\n\n\tstruct vfsmount *(*d_automount)(struct path *mountpoint);\n\ntakes a pointer to the directory to be mounted upon, which is expected to\nprovide sufficient data to determine what should be mounted.  If successful, it\nshould return the vfsmount struct it creates (which it should also have added\nto the namespace using do_add_mount() or similar).  If there\u0027s a collision with\nanother automount attempt, NULL should be returned.  If the directory specified\nby the parameter should be used directly rather than being mounted upon,\n-EISDIR should be returned.  In any other case, an error code should be\nreturned.\n\nThe -\u003ed_automount() operation is called with no locks held and may sleep.  At\nthis point the pathwalk algorithm will be in ref-walk mode.\n\nWithin fs/namei.c itself, a new pathwalk subroutine (follow_automount()) is\nadded to handle mountpoints.  It will return -EREMOTE if the automount flag was\nset, but no d_automount() op was supplied, -ELOOP if we\u0027ve encountered too many\nsymlinks or mountpoints, -EISDIR if the walk point should be used without\nmounting and 0 if successful.  The path will be updated to point to the mounted\nfilesystem if a successful automount took place.\n\n__follow_mount() is replaced by follow_managed() which is more generic\n(especially with the patch that adds -\u003ed_manage()).  This handles transits from\ndirectories during pathwalk, including automounting and skipping over\nmountpoints (and holding processes with the next patch).\n\n__follow_mount_rcu() will jump out of RCU-walk mode if it encounters an\nautomount point with nothing mounted on it.\n\nfollow_dotdot*() does not handle automounts as you don\u0027t want to trigger them\nwhilst following \"..\".\n\nI\u0027ve also extracted the mount/don\u0027t-mount logic from autofs4 and included it\nhere.  It makes the mount go ahead anyway if someone calls open() or creat(),\ntries to traverse the directory, tries to chdir/chroot/etc. into the directory,\nor sticks a \u0027/\u0027 on the end of the pathname.  If they do a stat(), however,\nthey\u0027ll only trigger the automount if they didn\u0027t also say O_NOFOLLOW.\n\nI\u0027ve also added an inode flag (S_AUTOMOUNT) so that filesystems can mark their\ninodes as automount points.  This flag is automatically propagated to the\ndentry as DCACHE_NEED_AUTOMOUNT by __d_instantiate().  This saves NFS and could\nsave AFS a private flag bit apiece, but is not strictly necessary.  It would be\npreferable to do the propagation in d_set_d_op(), but that doesn\u0027t normally\nhave access to the inode.\n\n[AV: fixed breakage in case if __follow_mount_rcu() fails and nameidata_drop_rcu()\nsucceeds in RCU case of do_lookup(); we need to fall through to non-RCU case after\nthat, rather than just returning with ungrabbed *path]\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nWas-Acked-by: Ian Kent \u003craven@themaw.net\u003e\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "977d8919cc69c80e9dd3f0e4a4e5327bac608376",
      "old_mode": 33188,
      "old_path": "Documentation/filesystems/Locking",
      "new_id": "5f0c52a07386ff849c7fb2078669df9e87fa8cdf",
      "new_mode": 33188,
      "new_path": "Documentation/filesystems/Locking"
    },
    {
      "type": "modify",
      "old_id": "cae6d27c9f5bfa006f3ee8a9b086e9627a6d0f2c",
      "old_mode": 33188,
      "old_path": "Documentation/filesystems/vfs.txt",
      "new_id": "726a4f6fa3c932dc5566c743e081f2f4c6b61e02",
      "new_mode": 33188,
      "new_path": "Documentation/filesystems/vfs.txt"
    },
    {
      "type": "modify",
      "old_id": "0c6d5c549d840008b4dfff4e45e1aa6cbdcb88f8",
      "old_mode": 33188,
      "old_path": "fs/dcache.c",
      "new_id": "51f7bb6463af03f72ffde7757a363c4e52838e52",
      "new_mode": 33188,
      "new_path": "fs/dcache.c"
    },
    {
      "type": "modify",
      "old_id": "529e917ad2fc24944efbe1749cfeee49317b15e3",
      "old_mode": 33188,
      "old_path": "fs/namei.c",
      "new_id": "16109da68bbffdd3f45035a3da6abe6a3db1c826",
      "new_mode": 33188,
      "new_path": "fs/namei.c"
    },
    {
      "type": "modify",
      "old_id": "59fcd24b146861a205803e3c1a7b4c7c3e478135",
      "old_mode": 33188,
      "old_path": "include/linux/dcache.h",
      "new_id": "ee6c26d142c3f94a5f089af62592175ae556031d",
      "new_mode": 33188,
      "new_path": "include/linux/dcache.h"
    },
    {
      "type": "modify",
      "old_id": "3984f2358d1f56d98de234203ddec0cc9f20b538",
      "old_mode": 33188,
      "old_path": "include/linux/fs.h",
      "new_id": "4c00ed53be8fcf309b1cd26df6d662c54d3e467f",
      "new_mode": 33188,
      "new_path": "include/linux/fs.h"
    }
  ]
}
