summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-10 07:56:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-10 08:00:35 +0000
commite6e5ccd3ba3b8b7560be002e92f711eab7386a10 (patch)
treedcffa7b73f521d8e5a21a8bcc741318f03d7e19a
parentUpdating source local-options. (diff)
downloadgvfs-e6e5ccd3ba3b8b7560be002e92f711eab7386a10.zip
gvfs-e6e5ccd3ba3b8b7560be002e92f711eab7386a10.tar.xz
Adding patches from upstream to fix volume removal with current udev behavior (Closes: #882353).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/patches/progress-linux/0001-mpt.patch35
-rw-r--r--debian/patches/progress-linux/0002-gphoto2.patch35
-rw-r--r--debian/patches/progress-linux/0003-monitor.patch56
-rw-r--r--debian/patches/series3
4 files changed, 129 insertions, 0 deletions
diff --git a/debian/patches/progress-linux/0001-mpt.patch b/debian/patches/progress-linux/0001-mpt.patch
new file mode 100644
index 0000000..6cb2bf4
--- /dev/null
+++ b/debian/patches/progress-linux/0001-mpt.patch
@@ -0,0 +1,35 @@
+Author: Ondrej Holy <oholy@redhat.com>
+Description: mtp: Fix volume removal with current udev behavior
+ UDev events for devices without ID_MTP_DEVICE property are ignored.
+ Although ID_MTP_DEVICE seems don't have to be set for device when removing
+ and thus the volume is not removed. Let's ignore ID_MTP_DEVICE when removing.
+ .
+ https://bugzilla.gnome.org/show_bug.cgi?id=789491
+
+diff -Naurp gvfs.orig/monitor/mtp/gmtpvolumemonitor.c gvfs/monitor/mtp/gmtpvolumemonitor.c
+--- gvfs.orig/monitor/mtp/gmtpvolumemonitor.c
++++ gvfs/monitor/mtp/gmtpvolumemonitor.c
+@@ -208,17 +208,12 @@ on_uevent (GUdevClient *client, gchar *a
+
+ g_debug ("on_uevent: action=%s, device=%s", action, g_udev_device_get_device_file(device));
+
+- /* filter out uninteresting events */
+- if (!g_udev_device_has_property (device, "ID_MTP_DEVICE"))
+- {
+- g_debug ("on_uevent: discarding, not ID_MTP");
+- return;
+- }
+-
+- if (strcmp (action, "add") == 0)
+- gudev_add_device (monitor, device, TRUE);
+- else if (strcmp (action, "remove") == 0)
+- gudev_remove_device (monitor, device);
++ if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_MTP_DEVICE"))
++ gudev_add_device (monitor, device, TRUE);
++ else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL)
++ gudev_remove_device (monitor, device);
++ else
++ g_debug ("on_uevent: discarding");
+ }
+
+ static void
diff --git a/debian/patches/progress-linux/0002-gphoto2.patch b/debian/patches/progress-linux/0002-gphoto2.patch
new file mode 100644
index 0000000..873d143
--- /dev/null
+++ b/debian/patches/progress-linux/0002-gphoto2.patch
@@ -0,0 +1,35 @@
+Author: Ondrej Holy <oholy@redhat.com>
+Description: gphoto2: Fix volume removal with current udev behavior
+ UDev events for devices without ID_GPHOTO2 property are ignored.
+ Although ID_GPHOTO2 seems don't have to be set for device when removing
+ and thus the volume is not removed. Let's ignore ID_GPHOTO2 when removing.
+ .
+ https://bugzilla.gnome.org/show_bug.cgi?id=789491
+
+diff -Naurp gvfs.orig/monitor/gphoto2/ggphoto2volumemonitor.c gvfs/monitor/gphoto2/ggphoto2volumemonitor.c
+--- gvfs.orig/monitor/gphoto2/ggphoto2volumemonitor.c
++++ gvfs/monitor/gphoto2/ggphoto2volumemonitor.c
+@@ -290,17 +290,12 @@ on_uevent (GUdevClient *client,
+
+ /* g_debug ("on_uevent: action=%s, device=%s", action, g_udev_device_get_device_file(device)); */
+
+- /* filter out uninteresting events */
+- if (!g_udev_device_has_property (device, "ID_GPHOTO2"))
+- {
+- /* g_debug ("on_uevent: discarding, not ID_GPHOTO2"); */
+- return;
+- }
+-
+- if (strcmp (action, "add") == 0)
+- gudev_add_camera (monitor, device, TRUE);
+- else if (strcmp (action, "remove") == 0)
+- gudev_remove_camera (monitor, device);
++ if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_GPHOTO2"))
++ gudev_add_camera (monitor, device, TRUE);
++ else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL)
++ gudev_remove_camera (monitor, device);
++ else
++ g_debug ("on_uevent: discarding");
+ }
+
+ /* Find all attached gphoto supported cameras; this is called on startup
diff --git a/debian/patches/progress-linux/0003-monitor.patch b/debian/patches/progress-linux/0003-monitor.patch
new file mode 100644
index 0000000..fe7b5fe
--- /dev/null
+++ b/debian/patches/progress-linux/0003-monitor.patch
@@ -0,0 +1,56 @@
+Author: Ondrej Holy <oholy@redhat.com>
+Description: monitor: Remove device file checks
+ The device file checks were added by mistake and it is not clear whether
+ it can't have some side-effect. Let's remove them and use g_strcmp0 for
+ sysfs path comparison for sure...
+ .
+ https://bugzilla.gnome.org/show_bug.cgi?id=789491
+
+diff -Naurp gvfs.orig/monitor/gphoto2/ggphoto2volume.c gvfs/monitor/gphoto2/ggphoto2volume.c
+--- gvfs.orig/monitor/gphoto2/ggphoto2volume.c
++++ gvfs/monitor/gphoto2/ggphoto2volume.c
+@@ -421,7 +421,7 @@ g_gphoto2_volume_has_path (GGPhoto2Volum
+ G_LOCK (gphoto2_volume);
+ res = FALSE;
+ if (gphoto2_volume->device != NULL)
+- res = strcmp (g_udev_device_get_sysfs_path (gphoto2_volume->device), sysfs_path) == 0;
++ res = g_strcmp0 (g_udev_device_get_sysfs_path (gphoto2_volume->device), sysfs_path) == 0;
+ G_UNLOCK (gphoto2_volume);
+ return res;
+ }
+diff -Naurp gvfs.orig/monitor/gphoto2/ggphoto2volumemonitor.c gvfs/monitor/gphoto2/ggphoto2volumemonitor.c
+--- gvfs.orig/monitor/gphoto2/ggphoto2volumemonitor.c
++++ gvfs/monitor/gphoto2/ggphoto2volumemonitor.c
+@@ -292,7 +292,7 @@ on_uevent (GUdevClient *client,
+
+ if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_GPHOTO2"))
+ gudev_add_camera (monitor, device, TRUE);
+- else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL)
++ else if (g_strcmp0 (action, "remove") == 0)
+ gudev_remove_camera (monitor, device);
+ else
+ g_debug ("on_uevent: discarding");
+diff -Naurp gvfs.orig/monitor/mtp/gmtpvolume.c gvfs/monitor/mtp/gmtpvolume.c
+--- gvfs.orig/monitor/mtp/gmtpvolume.c
++++ gvfs/monitor/mtp/gmtpvolume.c
+@@ -209,7 +209,7 @@ g_mtp_volume_has_path (GMtpVolume *volu
+ G_LOCK (mtp_volume);
+ res = FALSE;
+ if (mtp_volume->device != NULL)
+- res = strcmp (g_udev_device_get_sysfs_path (mtp_volume->device), sysfs_path) == 0;
++ res = g_strcmp0 (g_udev_device_get_sysfs_path (mtp_volume->device), sysfs_path) == 0;
+ G_UNLOCK (mtp_volume);
+ return res;
+ }
+diff -Naurp gvfs.orig/monitor/mtp/gmtpvolumemonitor.c gvfs/monitor/mtp/gmtpvolumemonitor.c
+--- gvfs.orig/monitor/mtp/gmtpvolumemonitor.c
++++ gvfs/monitor/mtp/gmtpvolumemonitor.c
+@@ -210,7 +210,7 @@ on_uevent (GUdevClient *client, gchar *a
+
+ if (g_strcmp0 (action, "add") == 0 && g_udev_device_has_property (device, "ID_MTP_DEVICE"))
+ gudev_add_device (monitor, device, TRUE);
+- else if (g_strcmp0 (action, "remove") == 0 && g_udev_device_get_device_file (device) != NULL)
++ else if (g_strcmp0 (action, "remove") == 0)
+ gudev_remove_device (monitor, device);
+ else
+ g_debug ("on_uevent: discarding");
diff --git a/debian/patches/series b/debian/patches/series
index 25f643f..853217c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,6 @@ dont-crash-on-null-job.patch
handle-inactive-vfs.patch
ref-jobs-in-thread.patch
disable-polkit-rules-no-admin.patch
+progress-linux/0001-mpt.patch
+progress-linux/0002-gphoto2.patch
+progress-linux/0003-monitor.patch