Skip to content

Commit 2c24517

Browse files
kiran-modukuriZhengShunQian
authored andcommitted
fscache: Allow cancelled operations to be enqueued
[ Upstream commit d0eb06a ] 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: 9ae326a ("CacheFiles: A cache that backs onto a mounted filesystem") Reported-by: Kiran Kumar Modukuri <[email protected]> Signed-off-by: David Howells <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0de4f79 commit 2c24517

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/fscache/operation.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ void fscache_enqueue_operation(struct fscache_operation *op)
6666
ASSERT(op->processor != NULL);
6767
ASSERT(fscache_object_is_available(op->object));
6868
ASSERTCMP(atomic_read(&op->usage), >, 0);
69-
ASSERTCMP(op->state, ==, FSCACHE_OP_ST_IN_PROGRESS);
69+
ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS,
70+
op->state, ==, FSCACHE_OP_ST_CANCELLED);
7071

7172
fscache_stat(&fscache_n_op_enqueue);
7273
switch (op->flags & FSCACHE_OP_TYPE) {
@@ -481,7 +482,8 @@ void fscache_put_operation(struct fscache_operation *op)
481482
struct fscache_cache *cache;
482483

483484
_enter("{OBJ%x OP%x,%d}",
484-
op->object->debug_id, op->debug_id, atomic_read(&op->usage));
485+
op->object ? op->object->debug_id : 0,
486+
op->debug_id, atomic_read(&op->usage));
485487

486488
ASSERTCMP(atomic_read(&op->usage), >, 0);
487489

0 commit comments

Comments
 (0)