diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-17 02:17:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:45 -0400 |
commit | 01e0fe0b10d8673554525984947cc5de21492462 (patch) | |
tree | 3f5633387be6fccb92085d4b20232854a57ed364 /drivers/usb | |
parent | 2452992aa78315bf0f510620d22fae8ecb40a2eb (diff) |
usbfs: kill racy detection of simple_pin_fs()
can check MS_KERNMOUNT in flags now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/inode.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 06c175aee6a3..cefa0c8b5b6a 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -50,7 +50,6 @@ | |||
50 | static const struct file_operations default_file_operations; | 50 | static const struct file_operations default_file_operations; |
51 | static struct vfsmount *usbfs_mount; | 51 | static struct vfsmount *usbfs_mount; |
52 | static int usbfs_mount_count; /* = 0 */ | 52 | static int usbfs_mount_count; /* = 0 */ |
53 | static int ignore_mount = 0; | ||
54 | 53 | ||
55 | static struct dentry *devices_usbfs_dentry; | 54 | static struct dentry *devices_usbfs_dentry; |
56 | static int num_buses; /* = 0 */ | 55 | static int num_buses; /* = 0 */ |
@@ -256,7 +255,7 @@ static int remount(struct super_block *sb, int *flags, char *data) | |||
256 | * i.e. it's a simple_pin_fs from create_special_files, | 255 | * i.e. it's a simple_pin_fs from create_special_files, |
257 | * then ignore it. | 256 | * then ignore it. |
258 | */ | 257 | */ |
259 | if (ignore_mount) | 258 | if (*flags & MS_KERNMOUNT) |
260 | return 0; | 259 | return 0; |
261 | 260 | ||
262 | if (parse_options(sb, data)) { | 261 | if (parse_options(sb, data)) { |
@@ -582,11 +581,6 @@ static int create_special_files (void) | |||
582 | struct dentry *parent; | 581 | struct dentry *parent; |
583 | int retval; | 582 | int retval; |
584 | 583 | ||
585 | /* the simple_pin_fs calls will call remount with no options | ||
586 | * without this flag that would overwrite the real mount options (if any) | ||
587 | */ | ||
588 | ignore_mount = 1; | ||
589 | |||
590 | /* create the devices special file */ | 584 | /* create the devices special file */ |
591 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); | 585 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); |
592 | if (retval) { | 586 | if (retval) { |
@@ -594,8 +588,6 @@ static int create_special_files (void) | |||
594 | goto exit; | 588 | goto exit; |
595 | } | 589 | } |
596 | 590 | ||
597 | ignore_mount = 0; | ||
598 | |||
599 | parent = usbfs_mount->mnt_root; | 591 | parent = usbfs_mount->mnt_root; |
600 | devices_usbfs_dentry = fs_create_file ("devices", | 592 | devices_usbfs_dentry = fs_create_file ("devices", |
601 | listmode | S_IFREG, parent, | 593 | listmode | S_IFREG, parent, |