diff options
author | wangrong <wangrong@uniontech.com> | 2023-01-05 10:08:44 +0000 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2023-01-05 10:08:44 +0000 |
commit | 718eae3d7e6a2c8d39fc0b0459d25ae5fc286ce6 (patch) | |
tree | 2a8584e3c53aa38021254f17cedc359744af488c /client | |
parent | 8327383e262e1e7f32750a8a2d3dd708195b0f53 (diff) | |
download | gvfs-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.c | 3 |
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; } |