summaryrefslogtreecommitdiff
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@aristanetworks.com>2010-02-13 06:22:23 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-08 04:04:52 +0300
commitf8d4f618fed5a4978afada52166bc2efaf7656d1 (patch)
tree3247344bc9e2cb39261336f25f345740b22622d0 /include/linux/sysfs.h
parentb35c74dab64f4c212f36d868419108556c9cf3e2 (diff)
downloadlinux-f8d4f618fed5a4978afada52166bc2efaf7656d1.tar.xz
sysfs: Serialize updates to the vfs inode
The vfs depends upon filesystem methods to update the vfs inode. Sysfs adds to the normal number of places where the vfs inode is updated by also updatng the vfs inode in sysfs_refresh_inode. Typically the inode mutex is used to serialize updates to the vfs inode, but grabbing the inode mutex in sysfs_permission and sysfs_getattr causes deadlocks, because sometimes the vfs calls those operations with the inode mutex held. Therefore sysfs can not use the inode mutex to serial updates to the vfs inode. The sysfs_mutex is acquired in all of the routines where sysfs updates the vfs inode, and with a small change we can consistently protext sysfs vfs inode updates with the sysfs_mutex. To protect the sysfs vfs inode updates with the sysfs_mutex simply requires extending the scope of sysfs_mutex in sysfs_setattr over inode_setattr, and over inode_change_ok (so we have an unchanging inode when we perform the check). Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/sysfs.h')
0 files changed, 0 insertions, 0 deletions