devtmpfs has a rw_lock dirlock which serializes delete_path and
create_path.
This code was obviously never tested with the usual set of debugging
facilities enabled. In the dirlock held sections the code calls:
- vfs functions which take mutexes
- kmalloc(, GFP_KERNEL)
In both code pathes the might sleep warning triggers and spams dmesg.
Convert the rw_lock to a mutex. There is no reason why this needs to
be a rwlock.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static int dev_mount;
#endif
static int dev_mount;
#endif
-static rwlock_t dirlock;
+static DEFINE_MUTEX(dirlock);
static int __init mount_param(char *str)
{
static int __init mount_param(char *str)
{
err = dev_mkdir(nodepath, 0755);
if (err == -ENOENT) {
char *path;
err = dev_mkdir(nodepath, 0755);
if (err == -ENOENT) {
char *path;
+ mutex_unlock(&dirlock);
if (!path)
return -ENOMEM;
if (!path)
return -ENOMEM;
- write_unlock(&dirlock);
+ mutex_unlock(&dirlock);
int err;
struct vfsmount *mnt;
int err;
struct vfsmount *mnt;
- rwlock_init(&dirlock);
-
err = register_filesystem(&dev_fs_type);
if (err) {
printk(KERN_ERR "devtmpfs: unable to register devtmpfs "
err = register_filesystem(&dev_fs_type);
if (err) {
printk(KERN_ERR "devtmpfs: unable to register devtmpfs "