]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.154/fscache-allow-cancelled-operations-to-be-enqueued.patch
Linux 5.1.4
[thirdparty/kernel/stable-queue.git] / releases / 4.4.154 / fscache-allow-cancelled-operations-to-be-enqueued.patch
CommitLineData
ef332cb8
GKH
1From foo@baz Tue Aug 28 16:10:37 CEST 2018
2From: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
3Date: Wed, 25 Jul 2018 14:31:20 +0100
4Subject: fscache: Allow cancelled operations to be enqueued
5
6From: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
7
8[ Upstream commit d0eb06afe712b7b103b6361f40a9a0c638524669 ]
9
10Alter the state-check assertion in fscache_enqueue_operation() to allow
11cancelled operations to be given processing time so they can be cleaned up.
12
13Also fix a debugging statement that was requiring such operations to have
14an object assigned.
15
16Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem")
17Reported-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
18Signed-off-by: David Howells <dhowells@redhat.com>
19Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 fs/fscache/operation.c | 6 ++++--
23 1 file changed, 4 insertions(+), 2 deletions(-)
24
25--- a/fs/fscache/operation.c
26+++ b/fs/fscache/operation.c
27@@ -66,7 +66,8 @@ void fscache_enqueue_operation(struct fs
28 ASSERT(op->processor != NULL);
29 ASSERT(fscache_object_is_available(op->object));
30 ASSERTCMP(atomic_read(&op->usage), >, 0);
31- ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS);
32+ ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS,
33+ op->state, ==, FSCACHE_OP_ST_CANCELLED);
34
35 fscache_stat(&fscache_n_op_enqueue);
36 switch (op->flags & FSCACHE_OP_TYPE) {
37@@ -481,7 +482,8 @@ void fscache_put_operation(struct fscach
38 struct fscache_cache *cache;
39
40 _enter("{OBJ%x OP%x,%d}",
41- op->object->debug_id, op->debug_id, atomic_read(&op->usage));
42+ op->object ? op->object->debug_id : 0,
43+ op->debug_id, atomic_read(&op->usage));
44
45 ASSERTCMP(atomic_read(&op->usage), >, 0);
46