Bug 833

Summary: modprobe usb-storage fails due to kernel thread doing funny stuff...
Product: Busybox Reporter: Alain Knaff <busybox>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.15.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: Patch to fix issue
Patch (fixed)

Description Alain Knaff 2009-12-30 09:13:35 UTC
modprobe usb-storage fails with a "Module already exists" error with 2.6.32.

The following seems to happen:

usb-storage depends on usb-libusual, so modprobe schedules first an insmod usb-libusual, and then usb-storage.

However, the kernel does funny stuff in usb-libusual's init, and spawns a thread to do "modprobe -q -- usb-storage". Usually, this thread wins the race, and usb-storage will already be present before the outer modprobe gets around to inserting it. With the result that it gets an error, because the module already exists.

It's more than a cosmetic problem, because this makes modprobing anything that depends on usb-storage impossible (such as ums-cypress)

The attached patch fixes the issue by ignoring EEXIST in do_modprobe
Comment 1 Alain Knaff 2009-12-30 09:46:40 UTC
Created attachment 873 [details]
Patch to fix issue
Comment 2 Alain Knaff 2009-12-30 21:02:45 UTC
Created attachment 875 [details]
Patch (fixed)

Previous patch had a typo. Fixed here.
Comment 3 Denys Vlasenko 2010-01-10 03:55:22 UTC
Applied to git, will be in 1.16.x. Thanks!