diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index 0a1cadf..429a2e6 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -1910,7 +1910,7 @@ g_local_file_trash (GFile         *file,
   char *data;
   gboolean is_homedir_trash;
   char delete_time[32];
-  int fd;
+  int fd, fddst;
   GStatBuf trash_stat, global_stat;
   char *dirname, *globaldir;
   GVfsClass *class;
@@ -2083,7 +2083,23 @@ g_local_file_trash (GFile         *file,
     g_free (infoname);
 
     fd = g_open (infofile, O_CREAT | O_EXCL, 0666);
-  } while (fd == -1 && errno == EEXIST);
+    /* only bother testing for .Trash/files/name if .Trash/info/name can
+     * be used */
+    if (fd != -1)
+      {
+        trashfile = g_build_filename (filesdir, trashname, NULL);
+        fddst = open (trashfile, O_CREAT | O_EXCL, 0666);
+        /* if we could create a file there, then delete it, because we
+         * want to move the file to delete there. This check is important
+         * on vfat file systems, see
+         * https://bugzilla.gnome.org/show_bug.cgi?id=764532 */
+        if (fddst != -1)
+            g_unlink (trashfile);
+        else
+            g_unlink (infofile);
+      }
+
+  } while ((fd == -1 || fddst == -1) && errno == EEXIST);
 
   g_free (basename);
   g_free (infodir);
