After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 545684 - G_FILE_ATTRIBUTE_ID_FILESYSTEM is wrong
G_FILE_ATTRIBUTE_ID_FILESYSTEM is wrong
Status: RESOLVED DUPLICATE of bug 529971
Product: nautilus
Classification: Core
Component: Trash
2.17.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-31 13:17 UTC by Nelson Benitez
Modified: 2008-08-01 19:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Nelson Benitez 2008-07-31 13:17:40 UTC
Please describe the problem:
Hi!,
G_FILE_ATTRIBUTE_ID_FILESYSTEM[1] is wrong in some case, in concrete when you have a file in the Trash, and you drag and drop it to a folder in your Home, the move operation is done by copying the file (as if they were on different filesystems) instead of a fast move operation.

Steps to reproduce:
1. Select a big file in nautilus, for example a file of 80MB, press Delete so it is moved to the Trash.
2. Open the Trash, drag the aforementioned file and drop it in its original location, as if you were recovering it.


Actual results:
A nautilus dialog appears saying the file is being moved while a progress bar shows how the file is being copied, the operation lasts more than 10 seconds as copying a 80MB file is not a quick operation.

Expected results:
A nautilus dialog appears saying the file is being moved and the file gets moved quickly because it doesn't need to copy the file as both the Trash and the target directory are on the same filesystem.

Does this happen every time?
Yes

Other information:
I assume you have your Trash and the directory you drop the file on the same filesystem, which is the normal situation.
Comment 1 Nelson Benitez 2008-07-31 13:18:40 UTC
(In reply to comment #0)
> Please describe the problem:
> Hi!,
> G_FILE_ATTRIBUTE_ID_FILESYSTEM[1] is wrong in some case, in concrete when you

Forget to put the reference to [1]..

[1] http://library.gnome.org/devel/gio/unstable/GFileInfo.html#G-FILE-ATTRIBUTE-ID-FILESYSTEM:CAPS
Comment 2 Johan (not receiving bugmail) Dahlin 2008-07-31 14:22:13 UTC
What would be useful here is the output of /bin/mount and gvfs-mount -l and the source and destination paths. Which GIO/GVFS backends are used to store the source and destination folders?
Comment 3 Nelson Benitez 2008-08-01 10:37:05 UTC
source and destination paths are:
trash:///_algo.zip 
file:///home/nelson/Escritorio 

Both source and destination paths are in the same ext3 partition of my linux box. The backend should be the default I think..

Comment 4 Nelson Benitez 2008-08-01 11:27:39 UTC
Well I've just seen my system has a process called "gvfsd-trash" so the trash:// uri probably has its own gvfs backend...
Comment 5 Johan (not receiving bugmail) Dahlin 2008-08-01 11:57:41 UTC
I can confirm this, move a file to Trash is fast, moving it from Trash is slow (eg, copy+delete).

I'm not sure if this is a bug in nautilus or in gio. Is nautilus calling g_file_copy or g_file_move?
Comment 6 Nelson Benitez 2008-08-01 13:32:36 UTC
I'm pretty confident it's a bug in GIO, in concrete in the G_FILE_ATTRIBUTE_ID_FILESYSTEM attribute, because nautilus has a function called check_same_fs, which in turn just compares the G_FILE_ATTRIBUTE_ID_FILESYSTEM of both files passed as parameters, this function returns FALSE for the two paths I said in comment 3, so if nautilus thinks the two files are in different filesystems it's normal that makes the operation as copy+delete, if G_FILE_ATTRIBUTE_ID_FILESYSTEM were the same for both files then probably nautilus would do a real move operation.


check_same_fs() is in http://svn.gnome.org/viewvc/nautilus/trunk/libnautilus-private/nautilus-dnd.c?view=markup

and nautilus_file_get_filesystem_id() is in
http://svn.gnome.org/viewvc/nautilus/trunk/libnautilus-private/nautilus-file.c?view=markup
Comment 7 Johan (not receiving bugmail) Dahlin 2008-08-01 13:50:04 UTC
Perhaps the Trash backend is not returning the file system id of the underlying filesystem? Could that be the case?
Comment 8 Nelson Benitez 2008-08-01 13:59:08 UTC
Yes, that could be the case, someone familiarized with gio code could check that, I'll try it but I'm new to gio code...
Comment 9 Johan (not receiving bugmail) Dahlin 2008-08-01 14:33:19 UTC
For a file in trash:///
  id::filesystem: type='trash',mount_prefix='/'
  id::file: l2054:2195866

For a file on the same file system as the file in trash:
  id::filesystem: l2054

I think this is a bug in nautilus, check_same_fs should be a bit more intelligent when deciding when to copy or move a file.

Comment 10 Christian Neumair 2008-08-01 19:33:59 UTC
This is not just about the same_fs_check, the problem is that we do not provide a move implementation across modules for moving files out of trash, i.e. bug 529971. I'm marking this one as a duplicate.

*** This bug has been marked as a duplicate of 529971 ***