Bug 70667 - can't unmount zip disk
can't unmount zip disk
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: nautilus (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Larsson
Jay Turner
:
: 73125 73126 (view as bug list)
Depends On:
Blocks: 67217
  Show dependency treegraph
 
Reported: 2002-08-03 11:57 EDT by Need Real Name
Modified: 2015-01-07 18:58 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-05 09:39:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
proposed patch (948 bytes, patch)
2002-09-02 21:23 EDT, Havoc Pennington
no flags Details | Diff

  None (edit)
Description Need Real Name 2002-08-03 11:57:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020712

Description of problem:
If I use nautilus to "delete" (move to trash) a file on a zip disk, then I can't
unmount the disk.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. start gnome/nautilus

2. mount a zip disk

3. create a file on the zip disk:
[grover@slick grover]$ touch /mnt/zip/fubar

4. use nautilus to delete the file -- open nautilus window, navigate to zip
disk, select file "fubar", hit delete key or right-click and select "move to trash"

5. close the nautilus window & try to unmount the zip disk

from xterm:
[grover@slick grover]$ umount /mnt/zip/
umount: /mnt/zip: device is busy

right-click the zip drive icon on the desktop & select eject:
I get a pop-up window which says: "Nautilus was unable to unmount the selected
volume." If I click on the details button on this window, I get a message:
"umount: /mnt/zip: device is busy."

right-click on the desktop, and select disks->zip drive:  
I get the same thing, a pop-up window which says: "Nautilus was unable to
unmount the selected volume." If I click on the details button on this window, I
get a message: "umount: /mnt/zip: device is busy."

6. sure enough, there is an open file:
[root@slick grover]# /usr/sbin/lsof | grep "/mnt/zip"
fam       8450  grover   18r   DIR       22,4    2048     97602
/mnt/zip/.Trash-grover

7. If I delete the .Trash* directory:
[grover@slick grover]$ rm -r /mnt/zip/.Trash-grover/
then I am sometimes able to unmount the zip drive, but sometimes an open
(deleted) file still shows under lsof:
[root@slick grover]# /usr/sbin/lsof | grep "/mnt/zip"
fam       8450  grover   18r   DIR       22,4    2048     97602
/mnt/zip/.Trash-grover (deleted)

Actual Results:  see above

Expected Results:  I should be able to use nautilus to browse & delete files on
a zip drive and then be able to unmount & eject the zip drive.

Additional info:

1. The zip drive on this system is a removable ide zip drive, mounted in a Dell
latitute c800 laptop.  I have no idea if the same thing happens with other types
of zip drive (pp, scsi, usb).

2. I can "solve" this problem by disabling fam:
[root@slick grover]# /sbin/chkconfig sgi_fam off
though, oddly, nautilus seems to think that it requires fam:
[root@slick grover]# rpm -e --test fam
error: Failed dependencies:
        libfam.so.0 is needed by (installed) gnome-vfs2-2.0.1-2
        libfam.so.0 is needed by (installed) kde2-compat-2.2.2-7
        fam is needed by (installed) nautilus-2.0.1-3

3. Suggested solutions: nautilus shouln't move "deleted" files into a .Trash*
directory on removable media, or fam shouln't monitor .Trash* files.
Comment 1 Havoc Pennington 2002-08-07 16:45:56 EDT
Alex this is a longstanding issue, is it Nautilus or FAM doing the wrong thing?
Comment 2 Alexander Larsson 2002-08-08 04:39:16 EDT
That depends on what you mean. FAM always needs to keep a file descriptor open
in a directory with watched files. But the real issue is that Nautilus monitors
the directory. Apparently the trash directory. I think it needs to monitor all
trash dirs to handle trash full/empty and stuff like that.
Comment 3 Havoc Pennington 2002-08-21 12:53:02 EDT
Alex can you look at this one? Seems to be one of the most important nautilus
bugs open.
Comment 4 Alexander Larsson 2002-08-27 11:45:18 EDT
Looking at the code it seems like it should try to remove the monitor on the
trash dir before unmounting when unmounting from nautilus. There must be some
bug preventing this.
Comment 5 Alexander Larsson 2002-08-28 11:04:14 EDT
This should be fixed in 2.0.5-4
Comment 6 Jay Turner 2002-08-30 14:17:58 EDT
Fix confirmed with nautilus-2.0.6-1.  You still have to wait a couple of moments
after deleting the file to unmount the volume, but it does work now.
Comment 7 Owen Taylor 2002-08-30 19:56:53 EDT
The fix has issues ... see bug 73125, bug 73126. Bill indicates that these
appeared between 2.0.5-3 and 2.0.5-4
Comment 8 Owen Taylor 2002-08-30 19:57:24 EDT
*** Bug 73125 has been marked as a duplicate of this bug. ***
Comment 9 Owen Taylor 2002-08-30 20:00:43 EDT
*** Bug 73126 has been marked as a duplicate of this bug. ***
Comment 10 Bill Nottingham 2002-08-30 20:34:29 EDT
And now, after rebooting with 2.0.6-1, it's working again. :/
Comment 11 Alexander Larsson 2002-08-31 05:16:55 EDT
notting, how did you reproduce that error. It looks like it gets several volumes
in the hashtable, but that should only happen if you have two mounts with the
same   mount path and device path. Very strange.

I wasn't able to reproduce your asserts with a floppy.
Comment 12 Havoc Pennington 2002-08-31 11:15:51 EDT
Could it be caused by slow or failing mounts - porkchop was 
hosed last night and I was seeing these asserts.
Comment 13 Alexander Larsson 2002-08-31 12:11:32 EDT
Can you reproduce it today?
Comment 14 Havoc Pennington 2002-08-31 12:45:55 EDT
I'm not in the office today...
Comment 15 Alexander Larsson 2002-09-02 08:07:18 EDT
I tried to bring my nfs server up and down, but i still couldn't get those asserts.
Comment 16 Havoc Pennington 2002-09-02 20:54:46 EDT
Alex, my theory is that in nautilus-trash-directory.c:get_trash_volume where 
we have this:
	if (*trash_volume != NULL && (*trash_volume)->real_directory != NULL) {
		return FALSE;
	}

we also need to check for a PENDING async job to fill in real_directory, 
and return FALSE if one is pending already.

What do you think?
Comment 17 Havoc Pennington 2002-09-02 21:08:10 EDT
(The reason is that there are several paths to calling add_volume, and if
finding the trash dir is slow, more than one could happen before we find the
trash dir.)
Comment 18 Havoc Pennington 2002-09-02 21:23:09 EDT
Created attachment 74569 [details]
proposed patch
Comment 19 Havoc Pennington 2002-09-02 23:31:37 EDT
Patch built into nautilus-2.0.6-5
Comment 20 Alexander Larsson 2002-09-03 02:31:21 EDT
That's what i guessed too, but i couldn't find the multiple ways that would
trigger it. But the patch should be safe.
Comment 21 Jay Turner 2002-09-04 08:03:58 EDT
Things are still looking good with nautilus-2.0.6-6.
Comment 22 Don Himelrick 2003-06-14 09:44:43 EDT
Still happening in nautilus 2.2.1-5 on RH9.  The exact same thing as described
in this bug.   Should I open a new bug?
Comment 23 Alexander Larsson 2003-07-04 08:37:55 EDT
Nah, i'll just reopen this one.
Comment 24 Alexander Larsson 2004-10-05 09:39:27 EDT
I think this is likely fixed in fc3 with gamin. Closing for now. If
you see anything like this in fc3test3 or later, please open a new bug
with full details.

Note You need to log in before you can comment on or make changes to this bug.