summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorwangrong <wangrong@uniontech.com>2023-01-05 10:08:44 +0000
committerOndrej Holy <oholy@redhat.com>2023-01-05 10:08:44 +0000
commit718eae3d7e6a2c8d39fc0b0459d25ae5fc286ce6 (patch)
tree2a8584e3c53aa38021254f17cedc359744af488c /client
parent8327383e262e1e7f32750a8a2d3dd708195b0f53 (diff)
downloadgvfs-718eae3d7e6a2c8d39fc0b0459d25ae5fc286ce6.tar.gz
fuse: Decrease file handle reference when open file fail
When the file fails to open, vfs_release() will not be called, which makes the file handle unable to be released, which will cause subsequent creation of the same name file to fail. Related: https://gitlab.gnome.org/GNOME/gvfs/-/issues/660
Diffstat (limited to 'client')
-rw-r--r--client/gvfsfusedaemon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index e2038504..1ccef249 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -1091,6 +1091,9 @@ open_common (const gchar *path, struct fuse_file_info *fi, GFile *file, int outp
g_mutex_unlock (&fh->mutex);
+ if (result < 0)
+ file_handle_unref (fh);
+
/* The added reference to the file handle is released in vfs_release() */
return result;
}