diff options
author | Li Zefan <lizefan@huawei.com> | 2014-02-14 16:57:27 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-14 14:31:37 -0800 |
commit | f41c593454943b80a2017c8a2a3d6b1d0b0a6f89 (patch) | |
tree | 3ecd1f3669b51386a716115a2da6809048149ce7 /fs/kernfs/dir.c | |
parent | 9383f4c6b66256c039c65ddc141f0caeeae51847 (diff) | |
download | linux-f41c593454943b80a2017c8a2a3d6b1d0b0a6f89.tar.bz2 |
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>
Diffstat (limited to 'fs/kernfs/dir.c')
-rw-r--r-- | fs/kernfs/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index a0f99b7f84b2..8245d3b34894 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -500,7 +500,7 @@ const struct dentry_operations kernfs_dops = { */ struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry) { - if (dentry->d_op == &kernfs_dops) + if (dentry->d_sb->s_op == &kernfs_sops) return dentry->d_fsdata; return NULL; } |