kernfs: fix kernfs_node_from_dentry()
authorLi Zefan <lizefan@huawei.com>
Fri, 14 Feb 2014 08:57:27 +0000 (16:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2014 22:31:37 +0000 (14:31 -0800)
commitf41c593454943b80a2017c8a2a3d6b1d0b0a6f89
tree3ecd1f3669b51386a716115a2da6809048149ce7
parent9383f4c6b66256c039c65ddc141f0caeeae51847
kernfs: fix kernfs_node_from_dentry()

Currently kernfs_node_from_dentry() returns NULL for root dentry,
because root_dentry->d_op == NULL.

Due to this bug cgroupstats_build() returns -EINVAL for root cgroup.

  # mount -t cgroup -o cpuacct /cgroup
  # Documentation/accounting/getdelays -C /cgroup
  fatal reply error,  errno -22

With this fix:

  # Documentation/accounting/getdelays -C /cgroup
  sleeping 305, blocked 0, running 1, stopped 0, uninterruptible 1

Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c
fs/kernfs/kernfs-internal.h
fs/kernfs/mount.c
This page took 0.036782 seconds and 5 git commands to generate.