Skip to contentSkip to conversation

USB: Remove BKL from remount() function in usbfs

PATCH In review Alessio Igor Bogani 2 participants 3 messages Mar 31, 2010 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: Remove BKL from remount() function in usbfs

The BKL was used into remount_fs pointed function for serialized access to super_block from the others super_operations functions.

The function update_sb(), invoked by remount(), seems already well serialized with &root->d_inode->i_mutex. Moreover don't seems there are others super_operations functions in USB core for usbfs that should access to super_block in a way which require BKL.

---
 drivers/usb/core/inode.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/usb/core/inode.c +0 -5
index 97b40ce..54972d6 100644
@@ -39,7 +39,6 @@
 #include <linux/parser.h>
 #include <linux/notifier.h>
 #include <linux/seq_file.h>
-#include <linux/smp_lock.h>
 #include <asm/byteorder.h>
 #include "usb.h"
 #include "hcd.h"
@@ -265,13 +264,9 @@ static int remount(struct super_block *sb, int *flags, char *data)
 		return -EINVAL;
 	}
 
-	lock_kernel();
-
 	if (usbfs_mount && usbfs_mount->mnt_sb)
 		update_sb(usbfs_mount->mnt_sb);
 
-	unlock_kernel();
-
 	return 0;
 }
 
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 8 lines · Alessio Igor Bogani

The BKL was used into remount_fs pointed function for serialized access to super_block from the others super_operations functions.

The function update_sb(), invoked by remount(), seems already well serialized with &root->d_inode->i_mutex. Moreover don't seems there are others super_operations functions in USB core for usbfs that should access to super_block in a way which require BKL.

There is a patch from Jan Blunck pending in the bkl-removal tree that pushes down the BKL into usbfs_fill_super. Can you confirm that this BKL usage does not interfere with the one you just removed, and that it can go the same way?

Arnd

#2 lore raw

Mr Bergmann,

2010/3/31 Arnd Bergmann <[email protected]>:
[...]

Quoted 8 lines
Quoted 4 lines

The function update_sb(), invoked by remount(), seems already well serialized with &root->d_inode->i_mutex. Moreover don't seems there are others super_operations functions in USB core for usbfs that should access to super_block in a way which require BKL.

There is a patch from Jan Blunck pending in the bkl-removal tree that pushes down the BKL into usbfs_fill_super. Can you confirm that this BKL usage does not interfere with the one you just removed, and that it can go the same way?

I can confirm that this certainly interfere: So please ignore my patch.

I'll elaborate a new patch when Blunck's works is merged.

Thanks!

Ciao,
Alessio