Opened 9 years ago

Closed 3 years ago

#6683 closed bug (invalid)

KDL when unplugging a mounted USB flash stick

Reported by: x-ist Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/Development
Keywords: Cc: umccullough, mdisreali@…
Blocked By: Blocking: #11704
Has a Patch: no Platform: All

Description

After having booted Haiku from an USB flash stick "A" and having plugged in another flash stick "B", mounting "B" and unplugging it afterwards leads to KDL.

One has to unmount the drive first to be able to safely remove the stick!

Attachments (2)

StickUnpludgedKdl.jpg (210.1 KB ) - added by x-ist 9 years ago.
KDL comming up imediatelly after pluggin out
StickUnpludgedKdl_Continue.jpg (181.2 KB ) - added by x-ist 9 years ago.
Next KDL after performing "continue".

Download all attachments as: .zip

Change History (21)

in reply to:  description ; comment:1 by Disreali, 9 years ago

Version: R1/alpha2R1/Development

Replying to x-ist:

One has to unmount the drive first to be able to safely remove the stick!

Every OS that I've used has the same requirement. That won't change. You answered your own question.

in reply to:  1 comment:2 by anevilyak, 9 years ago

Component: - GeneralSystem/Kernel
Owner: changed from nobody to axeld

Replying to Disreali:

Every OS that I've used has the same requirement. That won't change. You answered your own question.

Sure, but usually the result is data loss on the stick in question, not an OS panic. In this case however, the problem actually lies in the block cache, since it considers any failure to write a block back to disk as critical (which would probably bite you if a hard disk had a bad block as well). That should probably be reworked so the error can be propagated back to the originator of the write request, so decisions about how critical the failure is can be made where needed.

in reply to:  1 ; comment:3 by x-ist, 9 years ago

One has to unmount the drive first to be able to safely remove the stick!

Every OS that I've used has the same requirement. That won't change. You answered your own question.

The OSes I used show a message box (at worse), when you pull out the stick. Wrong user behavior must be tolerated at this point.

comment:4 by axeld, 9 years ago

The panic is only a debug helper, and should be removed for actual releases (I would remove it once we go beta).

In any case, please keep in mind that you've just corrupted some data on that stick, and the OS can't do anything about it but show you an error alert (or KDL in the case of Haiku ;-)).

comment:5 by x-ist, 9 years ago

Thanks for clarification about the KDL!

If it's not the Haiku system stick and its idle, i.e. there was no transaction for minutes I don't see a reason why I shouldn't be allowed to remove the stick.

Anyway, if there were transactions which must not be interrupted, an overlay above the drive icon indicating that the stick is "busy" would be really helpful. This way I would obviously see when its safe to unplug the stick.

in reply to:  5 comment:6 by anevilyak, 9 years ago

Replying to x-ist:

Anyway, if there were transactions which must not be interrupted, an overlay above the drive icon indicating that the stick is "busy" would be really helpful. This way I would obviously see when its safe to unplug the stick.

There's less guess work if you just right-click, unmount :) That forces all transactions to the stick to be flushed immediately.

comment:7 by x-ist, 9 years ago

sure. this would the other option :)

comment:8 by tangobravo, 9 years ago

I think somewhere (perhaps it was some Linux distro) I've seen a prompt asking for the stick to be replaced so that writing can be finished. That's a neat solution if it's possible without too much work. Also it's probably worth forcing somewhat regular flushes for removable media. Windows XP offers some option about how much caching to use that is by default set to the option to flush writes instantly IIRC, even though it probably has a transfer speed penalty.

in reply to:  8 comment:9 by x-ist, 9 years ago

Replying to tangobravo:

Also it's probably worth forcing somewhat regular flushes for removable media.

This would be the best way to go in my opinion, i.e. to flush the pending data automatically after a certain period of time, let's say 3 to 5 seconds. Thus entering the "nonbusy" mode.

in reply to:  4 comment:10 by umccullough, 9 years ago

Replying to axeld:

In any case, please keep in mind that you've just corrupted some data on that stick, and the OS can't do anything about it but show you an error alert (or KDL in the case of Haiku ;-)).

I don't believe that's an accurate assertion.

I get a KDL when pulling out a readonly-mounted USB stick as well (usually after copying some files off it to the HD).

Anyway, this is one of the absolutely most annoying KDLs currently - there seems to be no way to recover from it and I always end up rebooting.

comment:11 by umccullough, 9 years ago

Cc: umccullough added

in reply to:  3 comment:12 by Disreali, 9 years ago

Cc: mdisreali@… added

Replying to x-ist:

One has to unmount the drive first to be able to safely remove the stick!

Every OS that I've used has the same requirement. That won't change. You answered your own question.

The OSes I used show a message box (at worse), when you pull out the stick. Wrong user behavior must be tolerated at this point.

Sorry, you are right. Just ask umccullough.

comment:13 by luroh, 9 years ago

Duplicate of #4608, fixed in hrev41119?

in reply to:  13 comment:14 by x-ist, 9 years ago

Replying to luroh:

Duplicate of #4608, fixed in hrev41119?

This is hrev41884. Mounting in ReadOnly mode and unplugging works now with no KDL. However, in RW mode KDL still appears.

comment:15 by diver, 9 years ago

Please attach an image of such KDL.

by x-ist, 9 years ago

Attachment: StickUnpludgedKdl.jpg added

KDL comming up imediatelly after pluggin out

by x-ist, 9 years ago

Next KDL after performing "continue".

comment:16 by x-ist, 9 years ago

Here they are..

comment:17 by luroh, 5 years ago

Blocking: 11704 added

comment:18 by luroh, 5 years ago

Is this still repeatable after hrev49000?

comment:19 by axeld, 3 years ago

Resolution: invalid
Status: newclosed

The panic should still be active, since we haven't reached the beta yet. That's not a bug, though. The other issues mentioned here should already be fixed.

Note: See TracTickets for help on using tickets.