From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Tue, 8 Jul 2014 11:55:22 -0700 Subject: USB forceful removal In-Reply-To: References: Message-ID: <20140708185522.GA17779@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Jul 09, 2014 at 12:13:28AM +0530, AYAN KUMAR HALDER wrote: > Hi All, > > When a usb mass-storage is attached for the first time, it gets a > device (/dev/sda). > > When it is mounted and the device is manually removed and then when it > is attached again, it gets a different name ie /dev/sdb. Really? Not on my system, what kernel are you using? > This is because earlier the mass-storage device was removed (manually) > when it was mounted, so scsi_disk_release() did not get called as the > device (sda) had a reference count > 1. It should have... > So, if my understanding is correct, I would like to know if the above > mentioned behaviour is a bug or a limitation of the kernel? What is wrong with the device node showing back up as /dev/sdb? You shouldn't be relying on a device node name for doing anything "real" anyway, that's what /dev/disk/ is there for, the persistent links are designed for you to mount with. thanks, greg k-h