This commit is contained in:
parent
35a269ea85
commit
e6534075dc
95
gvfs-bnc368628-fuse-robustness.patch
Normal file
95
gvfs-bnc368628-fuse-robustness.patch
Normal file
@ -0,0 +1,95 @@
|
||||
diff -upr gvfs-0.2.3-pre/client/gvfsfusedaemon.c gvfs-0.2.3-post/client/gvfsfusedaemon.c
|
||||
--- gvfs-0.2.3-pre/client/gvfsfusedaemon.c 2008-04-07 20:27:44.000000000 -0500
|
||||
+++ gvfs-0.2.3-post/client/gvfsfusedaemon.c 2008-05-08 00:12:40.000000000 -0500
|
||||
@@ -71,6 +71,8 @@ typedef enum {
|
||||
} FileOp;
|
||||
|
||||
typedef struct {
|
||||
+ gint refcount;
|
||||
+
|
||||
GMutex *mutex;
|
||||
FileOp op;
|
||||
gpointer stream;
|
||||
@@ -188,12 +190,26 @@ file_handle_new (void)
|
||||
FileHandle *file_handle;
|
||||
|
||||
file_handle = g_new0 (FileHandle, 1);
|
||||
+ file_handle->refcount = 1;
|
||||
file_handle->mutex = g_mutex_new ();
|
||||
file_handle->op = FILE_OP_NONE;
|
||||
|
||||
return file_handle;
|
||||
}
|
||||
|
||||
+static FileHandle *
|
||||
+file_handle_ref (FileHandle *file_handle)
|
||||
+{
|
||||
+ g_atomic_int_inc (&file_handle->refcount);
|
||||
+ return file_handle;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+file_handle_unref (FileHandle *file_handle)
|
||||
+{
|
||||
+ return g_atomic_int_dec_and_test (&file_handle->refcount);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
file_handle_close_stream (FileHandle *file_handle)
|
||||
{
|
||||
@@ -278,21 +294,19 @@ reindex_file_handle_for_path (const gcha
|
||||
g_static_mutex_unlock (&global_mutex);
|
||||
}
|
||||
|
||||
-static gboolean
|
||||
+static void
|
||||
free_file_handle_for_path (const gchar *path)
|
||||
{
|
||||
FileHandle *fh;
|
||||
|
||||
- fh = get_file_handle_for_path (path);
|
||||
+ g_static_mutex_lock (&global_mutex);
|
||||
+ fh = g_hash_table_lookup (global_fh_table, path);
|
||||
if (fh)
|
||||
{
|
||||
- g_static_mutex_lock (&global_mutex);
|
||||
- g_hash_table_remove (global_fh_table, path);
|
||||
- g_static_mutex_unlock (&global_mutex);
|
||||
- return TRUE;
|
||||
+ if (file_handle_unref (fh))
|
||||
+ g_hash_table_remove (global_fh_table, path);
|
||||
}
|
||||
-
|
||||
- return FALSE;
|
||||
+ g_static_mutex_unlock (&global_mutex);
|
||||
}
|
||||
|
||||
static MountRecord *
|
||||
@@ -923,6 +937,7 @@ vfs_open (const gchar *path, struct fuse
|
||||
|
||||
/* File exists */
|
||||
|
||||
+ file_handle_ref (fh);
|
||||
SET_FILE_HANDLE (fi, fh);
|
||||
|
||||
debug_print ("vfs_open: flags=%o\n", fi->flags);
|
||||
@@ -1013,6 +1028,7 @@ vfs_create (const gchar *path, mode_t mo
|
||||
|
||||
/* Success */
|
||||
|
||||
+ file_handle_ref (fh);
|
||||
SET_FILE_HANDLE (fi, fh);
|
||||
|
||||
g_assert (fh->stream == NULL);
|
||||
@@ -1047,7 +1063,10 @@ vfs_release (const gchar *path, struct f
|
||||
debug_print ("vfs_release: %s\n", path);
|
||||
|
||||
if (fh)
|
||||
- free_file_handle_for_path (path);
|
||||
+ {
|
||||
+ if (!file_handle_unref (fh))
|
||||
+ free_file_handle_for_path (path);
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu May 8 08:10:49 CEST 2008 - hpj@suse.de
|
||||
|
||||
- Add gvfs-bnc368628-fuse-robustness.patch, which probably fixes
|
||||
BNC #368628.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 9 23:32:06 CEST 2008 - maw@suse.de
|
||||
|
||||
|
@ -25,12 +25,14 @@ BuildRequires: extra-rpm-macros
|
||||
%endif
|
||||
Summary: VFS functionality for GLib
|
||||
Version: 0.2.3
|
||||
Release: 1
|
||||
Release: 13
|
||||
License: LGPL v2.0 or later
|
||||
Group: Development/Libraries/C and C++
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
# PATCH-FIX-UPSTREAM gvfs-no-shebang.patch bgo523420 maw@suse.de -- Is this even worth upstreaming?
|
||||
Patch0: gvfs-no-shebang.patch
|
||||
# PATCH-FIX-UPSTREAM gvfs-bnc368628-fuse-robustness.patch bnc368628 hpj@novell.com
|
||||
Patch1: gvfs-bnc368628-fuse-robustness.patch
|
||||
Url: http://www.gnome.org
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
AutoReqProv: on
|
||||
@ -117,6 +119,7 @@ Authors:
|
||||
%prep
|
||||
%setup -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
|
||||
@ -171,6 +174,9 @@ chmod -x $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/*
|
||||
%files lang -f %{name}.lang
|
||||
|
||||
%changelog
|
||||
* Thu May 08 2008 hpj@suse.de
|
||||
- Add gvfs-bnc368628-fuse-robustness.patch, which probably fixes
|
||||
BNC #368628.
|
||||
* Thu Apr 10 2008 maw@suse.de
|
||||
- Update to version 0.2.3:
|
||||
+ WebDAV: implement set_display_name
|
||||
|
Loading…
Reference in New Issue
Block a user