diff options
author | Kiran Kumar Modukuri <kiran.modukuri@gmail.com> | 2018-07-25 09:31:20 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-07-25 09:31:20 -0400 |
commit | d0eb06afe712b7b103b6361f40a9a0c638524669 (patch) | |
tree | 584436c22f6df0a2e686065cca74de9230c42715 /fs/fscache | |
parent | fc36def997cfd6cbff3eda4f82853a5c311c5466 (diff) |
fscache: Allow cancelled operations to be enqueued
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 <kiran.modukuri@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r-- | fs/fscache/operation.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index e30c5975ea58..8d265790374c 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c | |||
@@ -70,7 +70,8 @@ void fscache_enqueue_operation(struct fscache_operation *op) | |||
70 | ASSERT(op->processor != NULL); | 70 | ASSERT(op->processor != NULL); |
71 | ASSERT(fscache_object_is_available(op->object)); | 71 | ASSERT(fscache_object_is_available(op->object)); |
72 | ASSERTCMP(atomic_read(&op->usage), >, 0); | 72 | ASSERTCMP(atomic_read(&op->usage), >, 0); |
73 | ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS); | 73 | ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS, |
74 | op->state, ==, FSCACHE_OP_ST_CANCELLED); | ||
74 | 75 | ||
75 | fscache_stat(&fscache_n_op_enqueue); | 76 | fscache_stat(&fscache_n_op_enqueue); |
76 | switch (op->flags & FSCACHE_OP_TYPE) { | 77 | switch (op->flags & FSCACHE_OP_TYPE) { |
@@ -499,7 +500,8 @@ void fscache_put_operation(struct fscache_operation *op) | |||
499 | struct fscache_cache *cache; | 500 | struct fscache_cache *cache; |
500 | 501 | ||
501 | _enter("{OBJ%x OP%x,%d}", | 502 | _enter("{OBJ%x OP%x,%d}", |
502 | op->object->debug_id, op->debug_id, atomic_read(&op->usage)); | 503 | op->object ? op->object->debug_id : 0, |
504 | op->debug_id, atomic_read(&op->usage)); | ||
503 | 505 | ||
504 | ASSERTCMP(atomic_read(&op->usage), >, 0); | 506 | ASSERTCMP(atomic_read(&op->usage), >, 0); |
505 | 507 | ||