Bug 78322 - preloaded instances may prevent unmount of filesystems
Summary: preloaded instances may prevent unmount of filesystems
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.2.1
Platform: RedHat Enterprise Linux Linux
: NOR major
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 69012 74413 75202 84249 86887 93143 97725 99441 104033 125157 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-23 19:48 UTC by eli
Modified: 2009-09-16 23:47 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Paint glitch after removing mounted disc (178.89 KB, image/png)
2008-05-12 12:08 UTC, Travis Evans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eli 2004-03-23 19:48:17 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    Unlisted Binary Package
OS:          Linux

Hi

KDE 3.2.1 from kde-redhat project
Fedora Core 1

After mounting my cdrom or my usb flash disk, then browsing the devices with 
Konqueror, then closing Konqueror, The Konqueror process remains active, even 
though I have quit all instances of Konqueror.

What this means is that I cannot unmount the device because it is busy until I 
manually kill the process with System Guard.

I was advised to:

Kcontrol-> KDE Components -> KDE Performance

In "preloading" section, set "Maximum number of (konqueror) instances 
kept preloaded" to 0.

This workaround worked.

This does not happen if I browse the device in a console.

Eli Wapniarski
Comment 1 Tommi Tervo 2004-03-23 19:53:43 UTC
Read comment #4 from bug 75202

*** This bug has been marked as a duplicate of 75202 ***
Comment 2 Rex Dieter 2004-03-23 20:48:30 UTC
The solution of disabling fam, isn't a solution.  It's a (horrible) workaround at best.

As noted in the last comment 13 (bug #37780#c13) of bug #37780 (from James Richard Tyler), floppy/cd cases are seemingly fixed.  Other items (like flash disks) may still be broken, and it is requested a separate/new bug report be filed.  *This* report serves as that separate bug report for usb flash devices.
Comment 3 Rex Dieter 2004-03-23 20:50:23 UTC
Sorry, comment reference of submitting new reports was comment #113 of bug #37780
Comment 4 former user 2004-04-17 12:12:37 UTC
When leaving a directory in konqueror it is still in use and it is not possible to unmount it because it is "busy". 

Leaving a directory shold leave it clean, no matter if fam, ssh etc. is used. (#76550)

# umount /dev/sdc1
umount: /mnt: device is busy
umount: /mnt: device is busy

# lsof /mnt
COMMAND PID USER   FD   TYPE DEVICE SIZE NODE NAME
famd    819 root  182r   DIR   8,33  512    1 /mnt

see also http://bugs.kde.org/show_bug.cgi?id=63463#c1
Comment 5 Tommi Tervo 2004-06-30 10:32:10 UTC
*** Bug 84249 has been marked as a duplicate of this bug. ***
Comment 6 Germain Garand 2004-08-11 01:51:11 UTC
*** Bug 86887 has been marked as a duplicate of this bug. ***
Comment 7 Sindre Aamås 2004-09-03 08:12:42 UTC
I have this problem with a usb-storage device on kde 3.3.0. However I don't have famd running. "lsof" shows konqueror using my /mnt/usb directory. This only happens sometimes, not everytime I access the device. The only way to umount the device is to kill konqueror. Should I file a seperate bug or is this the same problem?
Comment 8 Maksim Orlovich 2004-11-15 21:33:24 UTC
*** Bug 69012 has been marked as a duplicate of this bug. ***
Comment 9 Maksim Orlovich 2004-11-15 22:26:08 UTC
bug #87326 suggests the sidebar may play a role
Comment 10 Aaron J. Seigo 2005-01-03 11:41:06 UTC
*** Bug 74413 has been marked as a duplicate of this bug. ***
Comment 11 Aaron J. Seigo 2005-01-03 11:44:30 UTC
*** Bug 96107 has been marked as a duplicate of this bug. ***
Comment 12 Martin Koller 2005-02-15 22:50:57 UTC
*** Bug 97725 has been marked as a duplicate of this bug. ***
Comment 13 Martin C 2005-02-22 01:02:43 UTC
Hi, I found something else in this serious bug. It's serious because I just can't use my compact flash card because Konqueror doesn't want me to umount it. I reported it the first time with KDE 3.2 beta.

Well, the thing is that if I enter several times (over 10 times) in different directories in my filesystem it umounts without the busy thing! I'm using KDE 3.2 in Slackware 10. I think that the problem must be in the back history, what do you think?
Comment 14 f1jek 2005-03-16 10:06:27 UTC
I confirm the Eli problem, I am turning around since I have installed MDK 10.1 10 days ago. I have found exactly the same solution :

>In "preloading" section, set "Maximum number of (konqueror) instances
>kept preloaded" to 0.

I am happy to see that the same problem leads to the same solutions one year after...

Anyway, I confirm the problem for CD-ROM AND usb devices. I don't use kudzo nor supermount.

Jean-Luc Barraud  (MDK 10.1 official)
Comment 15 Maksim Orlovich 2005-04-16 20:38:22 UTC
*** Bug 104033 has been marked as a duplicate of this bug. ***
Comment 16 Zdenek Stepanek 2005-09-27 09:47:11 UTC
I also have this bug in 3.4.2.

I have USB disk mounted in /mnt/sda1.

When i enabled desktop icon in control panel "device icons" - "show device icons", then on desktop is icon "Hard drive (sda1)" (HDD). It works fine. click - mount - open window with media:/sda1. It works fine, also unmounting.

When i disabled those icons and place new icon - Create new - device - Camera. It have icon "camera", good. But after mount, *opening* and closing window, there is a result:

Unable to unmount device.

Reported error is:
umount: /mnt: device is busy
umount: /mnt: device is busy

It is a similar like a many reported bugs in this bugzilla.


Here is a my hints:

When i mount "camera" ant then umount, it works fine. Problem is raised, when i open konqueror with /mnt/sda1.

When i mount and open "hdd" icon - media:/sda1 and then unmount adn mount and unmount "camera", it works fine. -> Problem is in opened konqueror with */mnt/sda1*.

I also try create new device icon "MO disc" - work exactly same as "camera".

Why default desktop icon enabled in control panel open media:/sda1 and manually added icon open /mnt/sda1?
Comment 17 Tommi Tervo 2005-10-28 12:45:00 UTC
*** Bug 99441 has been marked as a duplicate of this bug. ***
Comment 18 Michael Scondo 2006-01-12 13:53:43 UTC
I'd also suggest that one should be able to eject the cd or whatever, even while konqueror e.g. shows its content.
Think of a newbie, inserting its cdrom, mounting it, wanting it to eject again - eh.
Most possibly he will restart his pc, disappointed by linux/kde.
Comment 19 jos poortvliet 2006-01-13 15:10:52 UTC
yeah, i agree with Michael Scondo. one should be able to unmount a disk if its opened but no files are changed. I hope for solid.kde.org to make this possible...
Comment 20 MarC 2006-01-14 20:22:32 UTC
I also agree with both of you and I don't think only of newbies. Sometimes I open a million of consoles and start operating different folders. When I decide to unmount a device I would like the ones which refer to the device to close automatically or warn me with a message in order to close them . IMHO even for a computer expert, it is useless to start searching all the applications that have read-only access to the mounted system before unmounting it.

However I am afraid that it is not only a kde problem, so it may be more difficult to solve. Even if kde handled this issue, any non-kde application with access to the mounted device could continue to prevent umount.

Sorry for such a long explanation, hope it helps!
Comment 21 Spiros Evangelatos 2006-02-21 22:44:36 UTC
The workaround that I use is setting "Maximum number of (konqueror) instances 
kept preloaded" to 1 and checking the preload an instance on login. That way I think that the preloaded instance that stays is in my home dir and does not interfere with removable devices. YOur mileage may vary.

As a quick workaround, may I propose all the preloaded instances to chdir to home or some of the kde temp dirs?
Comment 22 Rex Dieter 2006-02-22 15:17:53 UTC
AFAIK, konq already does the chdir to $HOME as you suggested.
Comment 23 Tommi Tervo 2006-04-08 12:08:19 UTC
*** Bug 125157 has been marked as a duplicate of this bug. ***
Comment 24 Carsten Lohrke 2006-05-07 19:43:31 UTC
Looks like bug 93143 is a dupe of this one.
Comment 25 Chris Howells 2006-05-21 05:20:24 UTC
*** Bug 93143 has been marked as a duplicate of this bug. ***
Comment 26 Dominik Haumann 2006-08-30 14:59:55 UTC
*** Bug 75202 has been marked as a duplicate of this bug. ***
Comment 27 Kevin Gilbert 2006-09-16 02:57:31 UTC
I am not sure whether this is still a problem!

I can have a konqueror window open on my USB flash drive and then umount it without any problems. The konqueror window then, obviously, shows the contents of the mount point directory (empty). When the flash drive is mounted again, voila, up pops the drives contents.

Which is exactly the behaviour I want / expect.
Comment 28 Adrian Dziubek 2006-09-21 22:30:29 UTC
I also have it working now:

Debian/unstable with:
Qt: 3.3.6
KDE: 3.5.4
Konqueror: 3.5.4

Thanks!
Comment 29 FiNeX 2006-10-08 22:22:00 UTC
Tested on Ubuntu Dapper Drake and Gentoo (both with KDE 3.5.4). Now mounting/umount is working correctly with floppy/cd/usbdrive/hardrive/flashdrive, even with multiple istances of konqueror loaded in background.

All works perfectly :-)
Comment 30 Travis Evans 2006-10-25 08:18:43 UTC
SUSE 10.1
KDE 3.5.4

I tried turning preloading back on in Konqueror, and I'm afraid I still appear to be having the problem.  If I simply browse the CD with Konqueror without clicking anything, then close Konqueror, I *can* unmount it, but if I open a file on the disc or right-click it and choose Properties, then Konqueror still holds the file open even after I close its window (according to lsof run in a console), and I can't unmount/eject the CD-ROM.

Can anyone reproduce this?  Here's an example of what's happening:

1. Insert Belkin Wireless router CD-ROM in /dev/hdb
2. Preloaded Konqueror instances set to 2. One Konqueror instance already running. Open CD-ROM icon on Desktop.
3. Konqueror opens to location "media:/hdb"
4. Double-click a folder named MANUAL (location "media:/hdb/MANUAL")
5. Close Konqueror
6. Right-click CD-ROM icon and choose Eject
7. CD-ROM ejects

But then:

8. Repeat steps 1-4 above
9. Right-click MANUAL.PDF (in "media:/hdb/MANUAL") and choose Properties
10. Click OK
11. Close Konqueror
12. Right-click CD-ROM icon and choose Eject

Nothing happens. Then when I open a terminal:

$ lsof /media/Belkin_F5D7230-4/MANUAL/MANUAL.PDF
COMMAND    PID     USER   FD   TYPE DEVICE    SIZE  NODE NAME
konqueror 5558 travisge   18r   REG   3,64 6859103 21762 /media/Belkin_F5D7230-4/MANUAL/MANUAL.PDF

$ kill 5558

$ lsof /media/Belkin_F5D7230-4/MANUAL/MANUAL.PDF
  <no output>

Now when I right-click the CD-ROM icon and choose Eject it finally ejects.
Comment 31 davide 2007-02-07 18:47:14 UTC
same problem here, with a curious note: it seems the problem arises only if I use a pdf document in the usb-pen :O

if I move around some non-pdf file in the usb-pen's fs the problem doesn't arise, but if I move a pdf then I found that konqueror is using some pdf file (some which I didn't touch, too), and doesn't permit the umount of the device

for example:
1- plug in the usb-pen (I disabled automount, so it's unmounted)
2- open konqueror
3- open media:/sda1
4- move media:/sda1/doc/doc1.pdf to media:/sda1/doc1.pdf
5- close konqueror

$ umount /dev/sda1                # I gave my user the permissions
                                  # required to use umount
umount: /mnt/pen1: device busy
umount: /mnt/pen1: device busy

$ lsof |grep pdf
 ...
konqueror 4975      davide  mem       REG        3,3   26840      26517 /usr/lib/kde3/kfile_pdf.so
konqueror 4975      davide  mem       REG        3,3    1081     916850 /usr/share/locale/it/LC_MESSAGES/kfile_pdf.mo
konqueror 4975      davide   19r      REG        8,1 2887372       1800 /mnt/pen1/doc/doc2.pdf

WTF!! I didn't move "doc2.pdf", but "doc1.pdf" !!

now:
1- killall konqueror
2- umount /dev/sda1
3- click on my "pen1" icon (or open media:/sda1 in konqueror, same result)
4- move media:/sda1/doc/doc1.odf to media:/sda1/
5- remove media:/sda1/doc/doc2.txt
6- umount /dev/sda1

all ok, even with konqueror still open 

I'm using konqueror 3.5.5a.dfsg.1-5 on debian etch
Comment 32 FiNeX 2008-05-05 00:00:33 UTC
With recent version of HAL/DBUS/FAM and 3.5.9 I've this problem no more. mounting/umounting works even on KDE 4.1 (trunk r802881).
I've tried to plug USB drives or mount CDs and umount them even with konqueror/dolphin/otherapps opened on the mounted FS. All is working fine!
Comment 33 Travis Evans 2008-05-12 07:49:39 UTC
I can confirm that the situation is far better now than before (KDE 3.5.8).  On the (now) rare occasions that I do get the message that the filesystem couldn't be unmounted, the dialog that shows the processes using it is very helpful.

Strangely, I notice that when I'm using the media:/ protocol in Konqueror and then remove the media I'm viewing, Konqueror stops painting the directory pane, resulting in some confusing display effects [I can draw multiple rubberband selections :-) ].  Does this happen to anyone else?
Comment 34 FiNeX 2008-05-12 09:33:49 UTC
@Travis: could you provide a screenshot please?
Exactly what should I do for reproduce it?
Comment 35 Travis Evans 2008-05-12 12:06:06 UTC
I can reproduce this with a new user account as well, so that should rule out anything in my personal config.  What I do is insert a DVD with files on it, load it in Konqueror using the "storage media" feature (so that the URL is in the form of either "system:/media/hd?" or "media:/hd?"), and then make sure I'm displaying it in List view (this doesn't seem to happen for Icon view).  Then when I eject the disk, the Konqueror window remains unchanged, and then if I drag a rubberband selection or another window over Konqueror, just the part that was covered is cleared, and everything else is not erased.

Once I insert a new disk and click Reload it works normally again until it's ejected.

This also doesn't seem to occur if I go directly to the mount point (e.g. "/media/cdrom0" instead of "system:/media/..." or "media:/...") and then remove the disc.
Comment 36 Travis Evans 2008-05-12 12:08:13 UTC
Created attachment 24730 [details]
Paint glitch after removing mounted disc
Comment 37 Travis Evans 2008-05-12 12:10:37 UTC
Oh yeah, this is with KDE 3.5.8 again (haven't quite gotten around to upgrading but I'll try to whenever I can).
Comment 38 FiNeX 2008-05-12 13:53:20 UTC
I've followed the comment #35 (bug #78322#c35). The file list isn't cleared after ejecting the disk but only with the list view (and I've no repaint issue), on the icon view mode all is working right. 
I've tested on 3.5.9.
Comment 39 LXj 2008-09-19 23:46:22 UTC
That issue is still there for me: KDE 4.1.1, openSUSE, after copying files to/from a flash drive (using ntfs-3g) I cannot unmount it. It seems like I don't have this issue if the FS is vfat
Comment 40 leszek 2008-12-16 10:47:47 UTC
I has a kde I have a propel a updade
Comment 41 FiNeX 2009-09-16 21:29:50 UTC
Please, would you like to check the bug using a more recent KDE version like 4.3 or trunk?

Many thanks.
Comment 42 Jens Herden 2009-09-16 22:28:49 UTC
I quickly tested Konqueror on KDE 4.3.1 and it seems that this problem does not exist anymore.
I tried a CD and an USB stick, both worked fine.
Comment 43 FiNeX 2009-09-16 23:47:39 UTC
I'm not able to reproduce this either. Thanks for the feedback Jens.