)]}'
{
  "commit": "7eafd7c74c3f2e67c27621b987b28397110d643f",
  "tree": "b4621aab78b6303f20386096c230b993044a4db7",
  "parents": [
    "614b84cf4e4a920d2af32b8f147ea1e3b8c27ea6"
  ],
  "author": {
    "name": "Serge E. Hallyn",
    "email": "serue@us.ibm.com",
    "time": "Mon Apr 06 19:01:10 2009 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Tue Apr 07 08:31:09 2009 -0700"
  },
  "message": "namespaces: ipc namespaces: implement support for posix msqueues\n\nImplement multiple mounts of the mqueue file system, and link it to usage\nof CLONE_NEWIPC.\n\nEach ipc ns has a corresponding mqueuefs superblock.  When a user does\nclone(CLONE_NEWIPC) or unshare(CLONE_NEWIPC), the unshare will cause an\ninternal mount of a new mqueuefs sb linked to the new ipc ns.\n\nWhen a user does \u0027mount -t mqueue mqueue /dev/mqueue\u0027, he mounts the\nmqueuefs superblock.\n\nPosix message queues can be worked with both through the mq_* system calls\n(see mq_overview(7)), and through the VFS through the mqueue mount.  Any\nusage of mq_open() and friends will work with the acting task\u0027s ipc\nnamespace.  Any actions through the VFS will work with the mqueuefs in\nwhich the file was created.  So if a user doesn\u0027t remount mqueuefs after\nunshare(CLONE_NEWIPC), mq_open(\"/ab\") will not be reflected in \"ls\n/dev/mqueue\".\n\nIf task a mounts mqueue for ipc_ns:1, then clones task b with a new ipcns,\nipcns:2, and then task a is the last task in ipc_ns:1 to exit, then (1)\nipc_ns:1 will be freed, (2) it\u0027s superblock will live on until task b\numounts the corresponding mqueuefs, and vfs actions will continue to\nsucceed, but (3) sb-\u003es_fs_info will be NULL for the sb corresponding to\nthe deceased ipc_ns:1.\n\nTo make this happen, we must protect the ipc reference count when\n\na) a task exits and drops its ipcns-\u003ecount, since it might be dropping\n   it to 0 and freeing the ipcns\n\nb) a task accesses the ipcns through its mqueuefs interface, since it\n   bumps the ipcns refcount and might race with the last task in the ipcns\n   exiting.\n\nSo the kref is changed to an atomic_t so we can use\natomic_dec_and_lock(\u0026ns-\u003ecount,mq_lock), and every access to the ipcns\nthrough ns \u003d mqueuefs_sb-\u003es_fs_info is protected by the same lock.\n\nSigned-off-by: Cedric Le Goater \u003cclg@fr.ibm.com\u003e\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: Alexey Dobriyan \u003cadobriyan@gmail.com\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": "3e6fcacebe8ac24d7995840e1d353f33c53f5df0",
      "old_mode": 33188,
      "old_path": "include/linux/ipc_namespace.h",
      "new_id": "3392d50de351536881a4bfeed0bf1bf36bc9e4ca",
      "new_mode": 33188,
      "new_path": "include/linux/ipc_namespace.h"
    },
    {
      "type": "modify",
      "old_id": "a3673a09069a7e71dbda2f3d0b24296a87704f74",
      "old_mode": 33188,
      "old_path": "ipc/mqueue.c",
      "new_id": "c82d7b51ef6801d4c477b59386ca7cfe9c5d0cc5",
      "new_mode": 33188,
      "new_path": "ipc/mqueue.c"
    },
    {
      "type": "modify",
      "old_id": "73c316cb8613a4dd8ad0c1bd0709eec95bfb6bbc",
      "old_mode": 33188,
      "old_path": "ipc/msgutil.c",
      "new_id": "f095ee26883333fcc69d7c32e907a8f1949e2f3f",
      "new_mode": 33188,
      "new_path": "ipc/msgutil.c"
    },
    {
      "type": "modify",
      "old_id": "4b4dc6d847f18c2129a09d1dfe1e92e24053dfed",
      "old_mode": 33188,
      "old_path": "ipc/namespace.c",
      "new_id": "4a5e752a92766d6e578c5c94499bdd71e60cbaf5",
      "new_mode": 33188,
      "new_path": "ipc/namespace.c"
    },
    {
      "type": "modify",
      "old_id": "0e7d9223acc18ba75585b52a5ddb6f71ace95897",
      "old_mode": 33188,
      "old_path": "ipc/util.h",
      "new_id": "1187332a89d2e54143b953dc1b63af829b9ee592",
      "new_mode": 33188,
      "new_path": "ipc/util.h"
    }
  ]
}
