From: Jianyu Zhan Date: Thu, 17 Apr 2014 09:52:10 +0000 (+0800) Subject: kernfs: fix a subdir count leak X-Git-Tag: omap-for-v3.16/pm-signed~47^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1befb885939cdaaf420c10bbe9ff57aa00446ea;p=pandora-kernel.git 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 Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed