Blame SOURCES/0120-core-don-t-change-removed-devices-to-state-tentative.patch

17b0f1
From 8e184ad6e23a8248e149cd5bf4f9bf56089a6dd1 Mon Sep 17 00:00:00 2001
17b0f1
From: Martin Pitt <martin.pitt@ubuntu.com>
17b0f1
Date: Fri, 13 Mar 2015 08:35:59 +0100
17b0f1
Subject: [PATCH] core: don't change removed devices to state "tentative"
17b0f1
17b0f1
Commit 628c89c introduced the "tentative" device state, which caused
17b0f1
devices to go from "plugged" to "tentative" on a remove uevent. This
17b0f1
breaks the cleanup of stale mounts (see commit 3b48ce4), as that only
17b0f1
applies to "dead" devices.
17b0f1
17b0f1
The "tentative" state only really makes sense on adding a device when
17b0f1
we don't know where it was coming from (i. e. not from udev). But when
17b0f1
we get a device removal from udev we definitively know that it's gone,
17b0f1
so change the device state back to "dead" as before 628c89c.
17b0f1
17b0f1
(cherry picked from commit 496068a8288084ab3ecf8b179a8403ecff1a6be8)
17b0f1
---
17b0f1
 src/core/device.c | 2 +-
17b0f1
 1 file changed, 1 insertion(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/core/device.c b/src/core/device.c
17b0f1
index 4ff8827219..cc4ebd2c87 100644
17b0f1
--- a/src/core/device.c
17b0f1
+++ b/src/core/device.c
17b0f1
@@ -421,7 +421,7 @@ static void device_update_found_one(Device *d, bool add, DeviceFound found, bool
17b0f1
         if (now) {
17b0f1
                 if (d->found & DEVICE_FOUND_UDEV)
17b0f1
                         device_set_state(d, DEVICE_PLUGGED);
17b0f1
-                else if (d->found != DEVICE_NOT_FOUND)
17b0f1
+                else if (add && d->found != DEVICE_NOT_FOUND)
17b0f1
                         device_set_state(d, DEVICE_TENTATIVE);
17b0f1
                 else
17b0f1
                         device_set_state(d, DEVICE_DEAD);