relan / exfat

Free exFAT file system implementation
GNU General Public License v2.0
800 stars 182 forks source link

When the eject exfat format U disk will report some errors #61

Closed JackieLiu1 closed 6 years ago

JackieLiu1 commented 7 years ago

Hello @relan I have an error about exfat-fuse here,When I click on the right mouse button eject, the kernel error message is as follows:

[  200.567159] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  200.567171] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[  200.567179] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Medium not present
[  200.567186] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 a0 00 00 f0 00
[  200.567191] blk_update_request: I/O error, dev sdb, sector 160
[  200.619342] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  200.619351] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[  200.619358] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Medium not present
[  200.619365] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 01 90 00 00 10 00
[  200.619370] blk_update_request: I/O error, dev sdb, sector 400

Another way is the same error

mount.exfat /dev/sdb1 /mnt -o nonempty
umount /dev/sdb1 && eject /dev/sdb1

My operation system is Ubuntu 16.10 linux kernel is 4.10.0+

can you help me ?

Thanks BR JackieLiu

JackieLiu1 commented 7 years ago

Open the kernel CONFIG_USB_STORAGE_DEBUG option,format the U disk file system for ext4 and exfat, get the dmesg information as follows: exfat.txt ext4.txt in exfat-fuse, you can see that there are a few READ command after the START_STOP command, in ext4, is clear. I think it is the error caused by several read and write commands after START_STOP

JackieLiu1 commented 7 years ago

By the way, Ntfs-3g also reported the same errors, but the kernel file system will not, I think it may be a fuse problem.

I am here to find a way to close this problem, but do not know why, so ask for your help

mount.exfat /dev/sdb1 /mnt -o nonempty
umount /dev/sdb1 && sleep 1 && eject /dev/sdb1
relan commented 7 years ago

No ideas, unfortunately. I'd suspect hardware issue. Did you try another USB stick?

JackieLiu1 commented 7 years ago

Thank you for your reply, I do not think it is a hardware problem, I tried four different manufacturers of U disk device, will have the same error, even worse, when opening the kernel CONFIG_SCSI_MQ_DEFAULT switch, will lead usb-storage process Use 100%, and then crash

BR

relan commented 7 years ago

Do you get those errors when you simply write something to the device from user space? I mean without any FS, just dd, for example.

JackieLiu1 commented 7 years ago

Yep, Test your idea a few minutes ago, the kernel reports the same problem

dd if=/dev/zero of=/dev/sdb1 bs=1M count=1M oflag=direct

at the same time, another terminal run

eject /dev/sdb1

dmesg information is similar, But I think this should really be reported this type of error, because it is in the write data when the eject.

relan commented 7 years ago

So, it's not FUSE. Try to report this issue to LKML.

JackieLiu1 commented 7 years ago

Is it ? OK, Thanks again. I will submit it to LKML

c384mb commented 7 years ago

Is necessary to consider still this fact, if during record on usb flash make reset or turn off the power, possible to receive the broken files and filesystem errors. I have seen this in Guests OS in VirtualBox. Check is made by means of chkdsk (exFAT) in Windows Host. At me such breakage of files happens not seldom, if to make reset Guests OS. Guest machines sometimes happens too freezes.

Once, I got spoiled spare GPT record (reset or turn off the power). On USB flash there was another file system (I don't remember exactly, maybe exFAT with fuse when I got spoiled spare GPT record).

relan commented 6 years ago

exFAT is not have any means of power outage resistance (and TexFAT is a different story).

Closing as there's no new info for over a year.