From 349bb8507725bed05b55110c2060d8e5af012508 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 12 Nov 2014 22:02:47 -0800 Subject: [PATCH] core/transaction: don't deeply inspect whether a JOB_NOP is destructive If a JOB_TRY_RESTART is issued for a unit which is already restarting, it gets reduced into a single JOB_NOP. We shouldn't call job_type_is_superset with a JOB_NOP because JOB_NOP is == _JOB_TYPE_MAX_MERGING, so we would trigger an assertion failure. https://bugs.freedesktop.org/show_bug.cgi?id=67427 --- src/core/transaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/transaction.c b/src/core/transaction.c index dbb4133..cba5c52 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -512,7 +512,8 @@ static int transaction_is_destructive(Transaction *tr, JobMode mode, sd_bus_erro assert(!j->transaction_prev); assert(!j->transaction_next); - if (j->unit->job && (mode == JOB_FAIL || j->unit->job->irreversible) && + if (j->unit->job && j->type != JOB_NOP && + (mode == JOB_FAIL || j->unit->job->irreversible) && !job_type_is_superset(j->type, j->unit->job->type)) { sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, -- 2.1.3