Commit d0eb06af authored by Kiran Kumar Modukuri's avatar Kiran Kumar Modukuri Committed by David Howells

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: 9ae326a6 ("CacheFiles: A cache that backs onto a mounted filesystem")
Reported-by: default avatarKiran Kumar Modukuri <kiran.modukuri@gmail.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent fc36def9
...@@ -70,7 +70,8 @@ void fscache_enqueue_operation(struct fscache_operation *op) ...@@ -70,7 +70,8 @@ void fscache_enqueue_operation(struct fscache_operation *op)
ASSERT(op->processor != NULL); ASSERT(op->processor != NULL);
ASSERT(fscache_object_is_available(op->object)); ASSERT(fscache_object_is_available(op->object));
ASSERTCMP(atomic_read(&op->usage), >, 0); 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); fscache_stat(&fscache_n_op_enqueue);
switch (op->flags & FSCACHE_OP_TYPE) { switch (op->flags & FSCACHE_OP_TYPE) {
...@@ -499,7 +500,8 @@ void fscache_put_operation(struct fscache_operation *op) ...@@ -499,7 +500,8 @@ void fscache_put_operation(struct fscache_operation *op)
struct fscache_cache *cache; struct fscache_cache *cache;
_enter("{OBJ%x OP%x,%d}", _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); ASSERTCMP(atomic_read(&op->usage), >, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment