]> git.baikalelectronics.ru Git - kernel.git/commit
sysfs: Take sysfs_mutex when fetching the root inode.
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 21 Jan 2009 19:55:11 +0000 (11:55 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Mar 2009 23:38:24 +0000 (16:38 -0700)
commitda9a39f1433aad0314ed08d8469c8003995af5d3
treeab039581d41c9fa45a1bac9eb843baa1312a5969
parentee932eeb7a188ecc001ae21e8981b1c7f743ece5
sysfs: Take sysfs_mutex when fetching the root inode.

sysfs_get_inode ultimately calls sysfs_count_nlink when the a
directory inode is fectched.  sysfs_count_nlink needs to be
called under the sysfs_mutex to guard against the unlikely
but possible scenario that the root directory is changing
as we are counting the number entries in it, and just in
general to be consistent.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/mount.c