Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3327138imu; Sun, 11 Nov 2018 12:27:20 -0800 (PST) X-Google-Smtp-Source: AJdET5duO7N3J8NDpaVSp678wGCQ1r9xXBwq0fOqDZ2Ph7E312rSsPN9l3uzTCCoh2r+tO49u4kh X-Received: by 2002:a62:83c2:: with SMTP id h185-v6mr17293511pfe.187.1541968040259; Sun, 11 Nov 2018 12:27:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968040; cv=none; d=google.com; s=arc-20160816; b=xuCvAtwJGuwCzrCikns7glQh5L5Z7bcLmWAk76UN65HlsUu7YxwbD3bKWVqi+NuQeI IQMAB4uDALZmoGCsUZtk+/HXq5LmpdDoaP/1djsyypTdt/Or5WROzBo0YbvXncmGf7Ye ZozXgDbw8U2kIuL1H5eB0cElo1J4qL3zAcBUEDnIMJdy+3R8aWuB1XYggh766L7pcEAS HaEOMd8yzi45/Rf6aM4Cv5Zd+OLs2Er2OrxbN/p8GGOtVtFcJdXqKkOhrqy3Jj7u8uP7 xx5iTlHZpE8yAYWZaqe4lLJv8HS7vukGucUOM9NxgHWJzxfIcploKQupgOJ6sm6PN7Oj j8hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=zLajgzf9/RRQ4TblgxpXJdxzOqw9tZa2mFBsvUDpQro=; b=xC/WxYXirSWIIanQQX+GdaGMLbZgq0ge8gALlA8gdkGgYQcCOzbuJWSrBqCkDhMLGS X6GbTTWM2r0imwVYujkVO/LUWR1tQiG00hQMMGEPOGxhGJBde0rGAWl6qqtQdPJohw3d e1/9DJ7vI86haku/VSaD9D2qWBF/pvlaPg5S4wdo4nKPo1gKBH7QAm4OVL+xD3HCXWIW a3tj5DJEPO4yhRX8B+BroRqOx8ql5kGi29DYtTGHNFDGSg0UrsQHC7CL0I7e2V8uIaay jQwoIbo1V/L5c9fJ0lojUhMu2h9LstIt7XcCreNy8opyk/+79pfJOgS6J4O1kzDz0t6x +AjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c41-v6si15524738plj.194.2018.11.11.12.27.04; Sun, 11 Nov 2018 12:27:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731369AbeKLGQJ (ORCPT + 99 others); Mon, 12 Nov 2018 01:16:09 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50882 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730636AbeKLFs1 (ORCPT ); Mon, 12 Nov 2018 00:48:27 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsl-0000l7-Pv; Sun, 11 Nov 2018 19:58:56 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsY-0001m6-36; Sun, 11 Nov 2018 19:58:42 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Kiran Kumar Modukuri" , "David Howells" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 288/366] fscache: Allow cancelled operations to be enqueued In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Kiran Kumar Modukuri commit d0eb06afe712b7b103b6361f40a9a0c638524669 upstream. Alter the state-check assertion in fscache_enqueue_operation() to allow cancelled operations to be given processing time so they can be cleaned up. Also fix a debugging statement that was requiring such operations to have an object assigned. Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem") Reported-by: Kiran Kumar Modukuri Signed-off-by: David Howells Signed-off-by: Ben Hutchings --- fs/fscache/operation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -37,7 +37,8 @@ void fscache_enqueue_operation(struct fs ASSERT(op->processor != NULL); ASSERT(fscache_object_is_available(op->object)); ASSERTCMP(atomic_read(&op->usage), >, 0); - ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS); + ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS, + op->state, ==, FSCACHE_OP_ST_CANCELLED); fscache_stat(&fscache_n_op_enqueue); switch (op->flags & FSCACHE_OP_TYPE) { @@ -401,7 +402,8 @@ void fscache_put_operation(struct fscach struct fscache_cache *cache; _enter("{OBJ%x OP%x,%d}", - op->object->debug_id, op->debug_id, atomic_read(&op->usage)); + op->object ? op->object->debug_id : 0, + op->debug_id, atomic_read(&op->usage)); ASSERTCMP(atomic_read(&op->usage), >, 0);