From 718eae3d7e6a2c8d39fc0b0459d25ae5fc286ce6 Mon Sep 17 00:00:00 2001 From: wangrong Date: Thu, 5 Jan 2023 10:08:44 +0000 Subject: 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 --- client/gvfsfusedaemon.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.1