Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2639 closed bug (fixed)

unable to mount ext3 partition with usb_disk

Reported by: emitrax Owned by: axeld
Priority: high Milestone: R1/alpha1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc: greg.gd@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Here is what I get when I try to mount my usb stick.

usb_disk: unhandled ioctl 22
usb_disk: unhandled ioctl 23
usb_disk: unhandled ioctl 13
usb_disk: unhandled ioctl 22
usb_disk: unhandled ioctl 23
file_cache: read pages failed: Is a directory

Attachments (3)

haiku_usbdisk_bug.txt (36.0 KB ) - added by aldeck 11 years ago.
Serial log of a mount + click to see the content
haiku-serial-port.txt (28.0 KB ) - added by aldeck 11 years ago.
haiku-serial-port2.txt (33.5 KB ) - added by aldeck 11 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by mmlr, 11 years ago

Any more details on that? What kind of device is it? Did it work previously? What filesystem do you try to mount?

I guess the ioctl's are for the device icons which are not implemented in usb_disk, they shouldn't be fatal at all though. Some days ago it was reported to me by aldeck on IRC that mounting did work, but the filesystem was empty after that. That's a regression with FAT it seems though and not related to usb_disk, as the device can be accessed correctly still.

in reply to:  1 comment:2 by emitrax, 11 years ago

Replying to mmlr:

Any more details on that? What kind of device is it? Did it work previously? What filesystem do you try to mount?

I can turn debug output on if there is one. It definitely used to work. It's an ext3 partition and it is detected during scanning. It's a normal usb stick.

I guess the ioctl's are for the device icons which are not implemented in usb_disk, they shouldn't be fatal at all though. Some days ago it was reported to me by aldeck on IRC that mounting did work, but the filesystem was empty after that. That's a regression with FAT it seems though and not related to usb_disk, as the device can be accessed correctly still.

About the ioctls I thought that too, but I thought they could be the cause.

When I mount it from the tracker, no icons appear on the desktop, but an "unnamed volume" entry is added to the root directory. Although an ls of it result in "Is a directory" error.

comment:3 by emitrax, 11 years ago

usb_disk: open(disk/usb/0/0/raw)
usb_disk: opening raw device disk/usb/0/0/raw for disk/usb/0/0/raw
usb_disk: unhandled ioctl 22
usb_disk: unhandled ioctl 23
usb_disk: close()
usb_disk: free()
usb_disk: open(disk/usb/0/0/raw)
usb_disk: opening raw device disk/usb/0/0/raw for disk/usb/0/0/raw
usb_disk: unhandled ioctl 13
usb_disk: close()
usb_disk: free()
usb_disk: open(disk/usb/0/0/raw)
usb_disk: opening raw device disk/usb/0/0/raw for disk/usb/0/0/raw
usb_disk: unhandled ioctl 22
usb_disk: unhandled ioctl 23
usb_disk: close()
usb_disk: free()
usb_disk: B_GET_MEDIA_STATUS: 0x00000000
usb_disk: B_GET_MEDIA_STATUS: 0x00000000
usb_disk: open(disk/usb/0/0/0)
usb_disk: opening raw device disk/usb/0/0/raw for disk/usb/0/0/0
usb_disk: read(32768, 1024)
usb_disk: read successful with 1024 bytes
usb_disk: B_GET_GEOMETRY: 3963904 sectors at 512 bytes per sector
usb_disk: read(35840, 4096)
usb_disk: read successful with 4096 bytes
usb_disk: read(539648, 4096)
usb_disk: read successful with 4096 bytes
file_cache: read pages failed: Is a directory
file_cache: read pages failed: Is a directory
usb_disk: B_GET_MEDIA_STATUS: 0x00000000
Last message repeated 4 times.

comment:4 by mmlr, 11 years ago

So it looks like it's not a usb_disk problem. Reads seem to work fine from a device standpoint of view. You can verify that by using DiskProbe to directly read from the device. If that works, it must be some upper layer that fails, as usb_disk solely provides the raw I/O.

You should try to find the exact location where this "Is a directory" comes from by tracking it from where the file cache output is generated.

in reply to:  4 comment:5 by emitrax, 11 years ago

Replying to mmlr:

So it looks like it's not a usb_disk problem. Reads seem to work fine from a device standpoint of view. You can verify that by using DiskProbe to directly read from the device. If that works, it must be some upper layer that fails, as usb_disk solely provides the raw I/O.

Yep, disk probes works.

You should try to find the exact location where this "Is a directory" comes from by tracking it from where the file cache output is generated.

I'll try that. Thanks.

comment:6 by aldeck, 11 years ago

Yep, have had problems with a FAT usb disk since a few (~hundreds) revisions. The disk was mountable, but the content was empty, after unmounting i couldn't mount it again.

It has even regressed a little more since a few revisions, now clicking on the disk icon makes it disapear and unmount immediately. After that the disk isn't available for mounting. See the attached serial log.

by aldeck, 11 years ago

Attachment: haiku_usbdisk_bug.txt added

Serial log of a mount + click to see the content

comment:7 by emitrax, 11 years ago

Component: - GeneralFile Systems/ext2
Summary: [usb_disk]: unable to mountunable to mount ext3 partition with usb_disk

Actually, it does mount another stick with a fat partition. The one that does not mount has an ext3 partition, which, IIRC, did mount previously.

comment:8 by PieterPanman, 11 years ago

My Fat stick does mount, but appears empty. Same ioctl output in syslog. Latest revision.

comment:9 by axeld, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev27088.

comment:10 by axeld, 11 years ago

Component: File Systems/ext2System/Kernel
Milestone: R1R1/alpha1
Priority: normalhigh

comment:11 by aldeck, 11 years ago

I've still got the problem with my fat usb disk (can't try ext3 right now). I guess it's a different bug then? I've got the same syslog as in my previous comment. Note for mmlr: Diskprobe shows only like 60 bytes of repetitive pattern and the rest is filled with zeroes. I can't access further blocks.

comment:12 by aldeck, 11 years ago

Should probably be moved to another ticket, but here is a quick update, as Axel asked:

It's a bit old in my memory now, but it seems it has evolved a bit. I can go to kdl quite easily just trying to mount and browse FAT usb disks ('read only' works apparently). I retried with my own build, build factory, several real hardware and vmwares, several sticks. I remember tryin freshly formated sticks too, but didn't have time to retry right now.

See the two atached syslogs, the first didn't kdl but did show the behaviour described in comment 6. The second went to kdl (easily reproducible).

A sure thing is that it worked like a charm :) on all my test machines and vm's with hrev26655 (i tested that one for a week and used usbdisks a lot).

by aldeck, 11 years ago

Attachment: haiku-serial-port.txt added

by aldeck, 11 years ago

Attachment: haiku-serial-port2.txt added

comment:13 by cebif, 11 years ago

Cc: greg.gd@… added
Note: See TracTickets for help on using tickets.