aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/sysfs.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-08-20 08:36:30 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:08 -0400
commit932ea2e374dd1ca26676297a5eccd1cdab86f7cd (patch)
tree83bba794de7f1f9f9290192f4f95a8ed9c91dfb6 /fs/sysfs/sysfs.h
parent89bec09705d2033b8b765f3c3ac5093f80bd5bc4 (diff)
sysfs: Introduce sysfs_rename_mutex
Looking carefully at the rename code we have a subtle dependency that the structure of sysfs not change while we are performing a rename. If the parent directory of the object we are renaming changes while the rename is being performed nasty things could happen when we go to release our locks. So introduce a sysfs_rename_mutex to prevent this highly unlikely theoretical issue. In addition hold sysfs_rename_mutex over all calls to sysfs_get_dentry. Allowing sysfs_get_dentry to be simplified in the future. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r--fs/sysfs/sysfs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 77253aabc4af..179e6a26ece1 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -90,6 +90,7 @@ extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr);
90 90
91extern spinlock_t sysfs_assoc_lock; 91extern spinlock_t sysfs_assoc_lock;
92extern struct mutex sysfs_mutex; 92extern struct mutex sysfs_mutex;
93extern struct mutex sysfs_rename_mutex;
93extern struct super_block * sysfs_sb; 94extern struct super_block * sysfs_sb;
94extern const struct file_operations sysfs_dir_operations; 95extern const struct file_operations sysfs_dir_operations;
95extern const struct file_operations sysfs_file_operations; 96extern const struct file_operations sysfs_file_operations;