summaryrefslogtreecommitdiffstats
path: root/fs/kernfs/file.c
diff options
context:
space:
mode:
authorJianyu Zhan <nasa4836@gmail.com>2014-04-17 11:52:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-25 21:25:13 +0200
commitc1befb885939cdaaf420c10bbe9ff57aa00446ea (patch)
treee46f5797e3b17838b41f874f70facaf7b52bfea5 /fs/kernfs/file.c
parentLinux 3.15-rc2 (diff)
downloadlinux-c1befb885939cdaaf420c10bbe9ff57aa00446ea.tar.xz
linux-c1befb885939cdaaf420c10bbe9ff57aa00446ea.zip
kernfs: fix a subdir count leak
Currently kernfs_link_sibling() increates parent->dir.subdirs before adding the node into parent's chidren rb tree. Because it is possible that kernfs_link_sibling() couldn't find a suitable slot and bail out, this leads to a mismatch between elevated subdir count with actual children node numbers. This patches fix this problem, by moving the subdir accouting after the actual addtion happening. Signed-off-by: Jianyu Zhan <nasa4836@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions