)]}'
{
  "commit": "ada723dcd681e2dffd7d73345cc8fda0eb0df9bd",
  "tree": "5f1b114d225721ae7a65fca08a6d053f89f36c43",
  "parents": [
    "27c0c8e511fa9e2389503926840fac606d90a049"
  ],
  "author": {
    "name": "Peter Zijlstra",
    "email": "peterz@infradead.org",
    "time": "Wed Feb 18 14:48:30 2009 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed Feb 18 15:37:55 2009 -0800"
  },
  "message": "fs/super.c: add lockdep annotation to s_umount\n\nLi Zefan said:\n\nThread 1:\n  for ((; ;))\n  {\n      mount -t cpuset xxx /mnt \u003e /dev/null 2\u003e\u00261\n      cat /mnt/cpus \u003e /dev/null 2\u003e\u00261\n      umount /mnt \u003e /dev/null 2\u003e\u00261\n  }\n\nThread 2:\n  for ((; ;))\n  {\n      mount -t cpuset xxx /mnt \u003e /dev/null 2\u003e\u00261\n      umount /mnt \u003e /dev/null 2\u003e\u00261\n  }\n\n(Note: It is irrelevant which cgroup subsys is used.)\n\nAfter a while a lockdep warning showed up:\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n[ INFO: possible recursive locking detected ]\n2.6.28 #479\n---------------------------------------------\nmount/13554 is trying to acquire lock:\n (\u0026type-\u003es_umount_key#19){--..}, at: [\u003cc049d888\u003e] sget+0x5e/0x321\n\nbut task is already holding lock:\n (\u0026type-\u003es_umount_key#19){--..}, at: [\u003cc049da0c\u003e] sget+0x1e2/0x321\n\nother info that might help us debug this:\n1 lock held by mount/13554:\n #0:  (\u0026type-\u003es_umount_key#19){--..}, at: [\u003cc049da0c\u003e] sget+0x1e2/0x321\n\nstack backtrace:\nPid: 13554, comm: mount Not tainted 2.6.28-mc #479\nCall Trace:\n [\u003cc044ad2e\u003e] validate_chain+0x4c6/0xbbd\n [\u003cc044ba9b\u003e] __lock_acquire+0x676/0x700\n [\u003cc044bb82\u003e] lock_acquire+0x5d/0x7a\n [\u003cc049d888\u003e] ? sget+0x5e/0x321\n [\u003cc061b9b8\u003e] down_write+0x34/0x50\n [\u003cc049d888\u003e] ? sget+0x5e/0x321\n [\u003cc049d888\u003e] sget+0x5e/0x321\n [\u003cc045a2e7\u003e] ? cgroup_set_super+0x0/0x3e\n [\u003cc045959f\u003e] ? cgroup_test_super+0x0/0x2f\n [\u003cc045bcea\u003e] cgroup_get_sb+0x98/0x2e7\n [\u003cc045cfb6\u003e] cpuset_get_sb+0x4a/0x5f\n [\u003cc049dfa4\u003e] vfs_kern_mount+0x40/0x7b\n [\u003cc049e02d\u003e] do_kern_mount+0x37/0xbf\n [\u003cc04af4a0\u003e] do_mount+0x5c3/0x61a\n [\u003cc04addd2\u003e] ? copy_mount_options+0x2c/0x111\n [\u003cc04af560\u003e] sys_mount+0x69/0xa0\n [\u003cc0403251\u003e] sysenter_do_call+0x12/0x31\n\nThe cause is after alloc_super() and then retry, an old entry in list\nfs_supers is found, so grab_super(old) is called, but both functions hold\ns_umount lock:\n\nstruct super_block *sget(...)\n{\n\t...\nretry:\n\tspin_lock(\u0026sb_lock);\n\tif (test) {\n\t\tlist_for_each_entry(old, \u0026type-\u003efs_supers, s_instances) {\n\t\t\tif (!test(old, data))\n\t\t\t\tcontinue;\n\t\t\tif (!grab_super(old))  \u003c--- 2nd: down_write(\u0026old-\u003es_umount);\n\t\t\t\tgoto retry;\n\t\t\tif (s)\n\t\t\t\tdestroy_super(s);\n\t\t\treturn old;\n\t\t}\n\t}\n\tif (!s) {\n\t\tspin_unlock(\u0026sb_lock);\n\t\ts \u003d alloc_super(type);   \u003c--- 1th: down_write(\u0026s-\u003es_umount)\n\t\tif (!s)\n\t\t\treturn ERR_PTR(-ENOMEM);\n\t\tgoto retry;\n\t}\n\t...\n}\n\nIt seems like a false positive, and seems like VFS but not cgroup needs to\nbe fixed.\n\nPeter said:\n\nWe can simply put the new s_umount instance in a but lockdep doesn\u0027t\nparticularly cares about subclass order.\n\nIf there\u0027s any issue with the callers of sget() assuming the s_umount lock\nbeing of sublcass 0, then there is another annotation we can use to fix\nthat, but lets not bother with that if this is sufficient.\n\nAddresses http://bugzilla.kernel.org/show_bug.cgi?id\u003d12673\n\nSigned-off-by: Peter Zijlstra \u003ca.p.zijlstra@chello.nl\u003e\nTested-by: Li Zefan \u003clizf@cn.fujitsu.com\u003e\nReported-by: Li Zefan \u003clizf@cn.fujitsu.com\u003e\nCc: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nCc: Paul Menage \u003cmenage@google.com\u003e\nCc: Arjan van de Ven \u003carjan@infradead.org\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": "61dce001dd572ef74685c42b0a1b83fa7307703b",
      "old_mode": 33188,
      "old_path": "fs/super.c",
      "new_id": "8349ed6b1412aa13e9f23d17fad91e66c9ec1915",
      "new_mode": 33188,
      "new_path": "fs/super.c"
    }
  ]
}
