Opened 15 years ago

Closed 14 years ago

#4602 closed bug (fixed)

"no name" by mounting USB devices ...

Reported by: stargater Owned by: axeld
Priority: normal Milestone: R1
Component: File Systems/FAT Version: R1/Development
Keywords: Cc: romain.haiku@…
Blocked By: Blocking:
Platform: x86

Description (last modified by mmlr)

"no name" by mounting USB devices from Tracker/Deskbar/Desktop and some one have true name Desktop, but not on Tracker menu "Mount"

In Terminal i have this outputs:

Hardware: -USB Stick TrekStor Go 64MB (my name= SG01) -Samsung SGH F480 Handy with Flashram + USB Karbel

~/Desktop> listusb 0204:6025 /dev/bus/usb/0/0 "" "" ver. 0100 0000:0000 /dev/bus/usb/0/hub "HAIKU Inc." "UHCI RootHub" ver. 0110 05c6:3111 /dev/bus/usb/1/0 "Samsung " "EXT USB " ver. 0002 0000:0000 /dev/bus/usb/1/hub "HAIKU Inc." "UHCI RootHub" ver. 0110 ~/Desktop>

and this

Hardware:

  • USB Stick (my name= Haiku)
  • USB TrekStor 20GB extern HD

~/Desktop> listusb 090c:1000 /dev/bus/usb/0/0 "USB" "DISK 2.0" ver. 1219 0000:0000 /dev/bus/usb/0/hub "HAIKU Inc." "UHCI RootHub" ver. 0110 0c0b:b136 /dev/bus/usb/1/0 "TrekStor" "HS020GB " ver. 0105 0000:0000 /dev/bus/usb/1/hub "HAIKU Inc." "UHCI RootHub" ver. 0110

Attachments (3)

dosfs_volume.diff (15.7 KB ) - added by romain 14 years ago.
updated patch
dosfs_volume_name.diff (936 bytes ) - added by romain 14 years ago.
Do not change volume label case in fs_stat
dosfs_volume_name2.diff (1.9 KB ) - added by romain 14 years ago.
sanatize volume name

Download all attachments as: .zip

Change History (17)

comment:1 by mmlr, 15 years ago

Component: Drivers/USBFile Systems/FAT
Description: modified (diff)
Owner: changed from mmlr to nobody

I'm assuming a FAT problem. Volume name handling in FAT is problematic as it stores it in two different places. I've tried to unify the name reading once, but apparently failed. No real motivation to dig into FAT again.

comment:2 by anevilyak, 14 years ago

Owner: changed from nobody to stippi
Status: newassigned
Version: R1/alpha1R1/Development

comment:3 by romain, 14 years ago

Here is a proposed patch to fix this. The "no name" in the mount menu comes from the fact that the volume label is stored in the root directory label. This is handled in the mount code, but not in the volume identification code. I moved part of the mount code to a new function that is now used both in mount and identify. I expect to put all this in a Volume class, the same way than in the ext2fs code, when I have a global overview of the fat code.

However I always have a correct name on the tracker volume icon here. Can you say with what tool your device was formatted when you had "no name" on the tracker volume icon ?

comment:4 by stippi, 14 years ago

Thanks a lot for the patch! A few things to note: Can you check your editor settings for spaces versus tabs? In Haiku, all code uses tabs, except for imported code. In terms of coding style, you comply to it inconsistently. Do you want to review your patch yourself, or should I go over it and you can see what exactly I was picky about? :-)

comment:5 by romain, 14 years ago

Concerning the tabs, I saw this after modifying the code and thought I fixed them before submitting the patch but it seems I forgot part of them. I will look at all this and provide another patch.

by romain, 14 years ago

Attachment: dosfs_volume.diff added

updated patch

comment:6 by stippi, 14 years ago

Applied the patch in hrev35262. A remaining oddity is that before mounting, the volume name is all upper case, while after mounting, it's all lower case. Should this be fixed before closing this ticket? Thanks a lot for your work, romain, and sorry for the slight delay in applying your patch!

comment:7 by romain, 14 years ago

I also have this on my system. The device fat entry is all in uppercase. I thought that the lowercase conversion was done by the tracker. I will look at this.

by romain, 14 years ago

Attachment: dosfs_volume_name.diff added

Do not change volume label case in fs_stat

comment:8 by romain, 14 years ago

Added a new patch. There was a part of code where the volume label was intentionally converted to lowercase. Not sure whether this behavior is expected or not.

comment:9 by axeld, 14 years ago

I would prefer the other way around, and keep sanitizing the label to something easier on the eye than caps :-)

And of course it was intentionally, or how else did you think this code ended up there? ;-)) (the scanning code was added at a later time, this was done differently before)

comment:10 by romain, 14 years ago

Ok, so should I provide another patch that applies the lowercase conversion systematically so that all menus in tracker provide the same input ? Should I keep the same code, or do we try some more manipulations on the volume label (e.g. if the fat label is not uppercase only, keep it as is) ?

by romain, 14 years ago

Attachment: dosfs_volume_name2.diff added

sanatize volume name

comment:11 by romain, 14 years ago

This new patch sanitize the volume name also when identifying the partition. Now the names are also lowercase in the tracker icons and the tracker mount menu.

comment:12 by romain, 14 years ago

Cc: romain.haiku@… added

comment:13 by axeld, 14 years ago

Owner: changed from stippi to axeld
Status: assignedin-progress

comment:14 by axeld, 14 years ago

Resolution: fixed
Status: in-progressclosed

Applied in hrev35523. There were a few style violations (some copied, some new) that I took the liberty to fix before applying.

Thanks for your patch, and sorry for the long delay!

Note: See TracTickets for help on using tickets.