]>
Commit | Line | Data |
---|---|---|
ef332cb8 GKH |
1 | From foo@baz Tue Aug 28 16:10:37 CEST 2018 |
2 | From: Kiran Kumar Modukuri <kiran.modukuri@gmail.com> | |
3 | Date: Wed, 25 Jul 2018 14:31:20 +0100 | |
4 | Subject: fscache: Allow cancelled operations to be enqueued | |
5 | ||
6 | From: Kiran Kumar Modukuri <kiran.modukuri@gmail.com> | |
7 | ||
8 | [ Upstream commit d0eb06afe712b7b103b6361f40a9a0c638524669 ] | |
9 | ||
10 | Alter the state-check assertion in fscache_enqueue_operation() to allow | |
11 | cancelled operations to be given processing time so they can be cleaned up. | |
12 | ||
13 | Also fix a debugging statement that was requiring such operations to have | |
14 | an object assigned. | |
15 | ||
16 | Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem") | |
17 | Reported-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com> | |
18 | Signed-off-by: David Howells <dhowells@redhat.com> | |
19 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
20 | Signed-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 |