Bug 233697
Summary: | suspend causes unnecssary device remove/add events for USB | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Zeuthen <davidz> |
Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
Status: | CLOSED WONTFIX | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 12 | CC: | mclasen, michel.salim, mildred-bug.redhat, mszpak, pjones, richard |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-12-05 07:16:48 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: |
Description
David Zeuthen
2007-03-23 20:25:43 UTC
What does happen if a user suspends, unplugs a USB key, modifies its contents, plugs it back, and resumes? In such a case, there would be no change between the state of USB bus between the before-suspend state and after-resume state. In that case the user would see data corruption - just as if he mounts a piece of removable media in a USB card reader; yanks out the card and modifies it elsewhere, and then puts it back in. (In most cases this isn't an issue though since HAL polls the drive.) I my opinion we can't really defend ourselves against such users... We can of course add checks in the file system drivers in the resume hooks to validate the super block and mount read-only if something change. So I would say that the USB core should punt this to higher level drivers. Btw, do you think the example you raised is likely to occur frequently in the real world? No, we're not removing any usb modules. It wouldn't really be a reasonable thing to do ever, at all. I agree you shouldn't be getting uevents unless the state appears to have *changed* while the device was down. I don't know how feasible that is though, because I really don't know anything about the bus protocol for enumerating a usb bus. One thing to note is that Windows has an interesting strategy on how to handle the "stupid user" case you mentioned -- which is essentially that they on removable writable storage, they aggressively write back data and leave the on-disk state looking like it isn't mounted as much of the time as possible. David: I don't think that the example of a card reader is a good analogy, because card readers report a check confition with key 6 and ASC/ASCQ 0x3A/0 upon the next access. The polling by HAL only serves to discover this condition, because there's no asynchronous event of any kind. The polling would still report it even if you pull and reinsert the card in less then 2 seconds. If readers did not detect the card removal, it would be just like you described (as I understood your mental model). The corruption of a card is prevented by taking a SCSI volume off-line if 0x3A happens (assuming that there wasn't unwritten dirty data). Current filesystem cannot add new dirty data into the (replaced) media. The volume has to be mounted again. So nothing should corrupt anything even if HAL is not polling. Personally, I don't want to challenge your scheme. As long as you realize the drawbacks, it's all good to me. All I need is some kind of position to present upstream (e.g. Greg Kroah, but also Alan Stern). To answer the question regarding the likelyhood, I'm afraid that it may be likely, based on how my family uses computers. Teaching them to use "Safely remove hardware" mechanism in Windows proves utterly impossible. They feel entitled to pull USB keys freely. The school of hard knocks taught them to press Ctrl-S, but that's just about the limit. I think that auto-suspend on lid close is going to make this situation worse. How about just playing it safe and unmounting every removable storage during the suspend process? If it fails (perhaps due to open files), force remounting read-only. On resume, try remounting the devices that were mounted if they're still connected. Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. I have the same problem with Fedora 11. This is very unpleasant for me, because I have F11 installed on an USB drive and due to that behavior I can't suspend my Fedora. There could be a way to mark an USB device as a "fixed" one - user is responsible for that it won't be unplugged from a computer in the meantime. This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping The same with Fedora 12. This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '12'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |