| Summary: | "safely remove" unmounts usb flash disk while it is still in use (flashing) | ||
|---|---|---|---|
| Product: | [I don't know] kde | Reporter: | khotyanovsky |
| Component: | general | Assignee: | Stephan Kulow <coolo> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | cimmino.marco, shiverma |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
khotyanovsky
2007-03-22 19:10:00 UTC
When the usb disk is "safely removed" and its icon turns into unmounted state the usb disk is still in /etc/mtab, so it is not really unmounted. See also this thread: http://www.linuxquestions.org/questions/showthread.php?t=517309&highlight=kde+safely+remove Exactly the same problem here. My system runs: KDE 3.5.5 (kubuntu edgy), kernel 2.6.17-11-generic. I have the same, KDE 3.5.5 (actually, I have had it since many releases back). And khotyanovsky is right, the system still has it mounted. It has to, otherwise it would be unable to flush cache. Current specs: distro: Gentoo KDE: 3.5.5 HAL: 0.5.7.1 Dbus: 1.0.2 kernel: 2.6.19-gentoo-r5 GCC: 4.1.1 pmount: 0.9.13 CFLAGS: "-O2 -march=athlon-xp -pipe" SVN commit 662500 by coolo:
make sure we unmount the device before we even try to
eject - and give correct error message if the device is busy
BUG: 143353
M +7 -7 mediamanager/halbackend.cpp
M +9 -5 mounthelper/kio_media_mounthelper.cpp
--- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/halbackend.cpp #662499:662500
@@ -1037,14 +1037,14 @@
QString proclist(listUsingProcesses(medium));
qerror = "<qt>";
- qerror += i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
+ qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
"currently mounted at <b>%4</b> could not be unmounted. ").arg(
"system:/media/" + medium->name(),
medium->deviceNode(),
medium->prettyLabel(),
- medium->prettyBaseURL().pathOrURL());
- qerror += i18n("The following error was returned by umount command:");
- qerror += "<br><pre>" + job->errorText() + "</pre>";
+ medium->prettyBaseURL().pathOrURL()) + "</p>";
+ qerror += "<p>" + i18n("The following error was returned by umount command:");
+ qerror += "</p><pre>" + job->errorText() + "</pre>";
if (!proclist.isEmpty()) {
qerror += proclist;
@@ -1273,13 +1273,13 @@
kdDebug() << "unmount failed for " << udi << ": " << error.name << " " << error.message << endl;
qerror = "<qt>";
- qerror += i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
+ qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
"currently mounted at <b>%4</b> could not be unmounted. ").arg(
"system:/media/" + medium->name(),
medium->deviceNode(),
medium->prettyLabel(),
- medium->prettyBaseURL().pathOrURL());
- qerror += i18n("Unmounting failed due to the following error:");
+ medium->prettyBaseURL().pathOrURL()) + "</p>";
+ qerror += "<p>" + i18n("Unmounting failed due to the following error:") + "</p>";
if (!strcmp(error.name, "org.freedesktop.Hal.Device.Volume.Busy")) {
reason = i18n("Device is Busy:");
} else if (!strcmp(error.name, "org.freedesktop.Hal.Device.Volume.NotMounted")) {
--- branches/KDE/3.5/kdebase/kioslave/media/mounthelper/kio_media_mounthelper.cpp #662499:662500
@@ -117,10 +117,14 @@
DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call( "unmount", medium.id());
if (reply.isValid())
- reply.get(m_errorStr);
+ reply.get(m_errorStr);
+ if (m_errorStr.isNull())
+ invokeEject(device, true);
+ else
+ error();
m_device = device;
- }
- invokeEject(device, true);
+ } else
+ invokeEject(device, true);
}
else
{
@@ -130,7 +134,7 @@
reply.get(m_errorStr);
if (m_errorStr.isNull())
::exit(0);
- else
+ else
error();
}
}
@@ -201,5 +205,5 @@
app->dcopClient()->attach();
return app->exec();
}
-
+
#include "kio_media_mounthelper.moc"
*** Bug 135558 has been marked as a duplicate of this bug. *** |