diff options
author | Kiran Kumar Modukuri <kiran.modukuri@gmail.com> | 2018-07-25 14:31:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-05 09:16:21 +0200 |
commit | a60d0786f758051c0786a36e69ad07fcf6917b44 (patch) | |
tree | 8fd478782118500814370b90d0b6bfb66c07203e /fs | |
parent | 903d5b843dc6b9f25fe35033c0aa376be133c8b4 (diff) | |
download | linux-stable-a60d0786f758051c0786a36e69ad07fcf6917b44.tar.gz linux-stable-a60d0786f758051c0786a36e69ad07fcf6917b44.tar.bz2 linux-stable-a60d0786f758051c0786a36e69ad07fcf6917b44.zip |
fscache: Allow cancelled operations to be enqueued
[ Upstream commit d0eb06afe712b7b103b6361f40a9a0c638524669 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 e7b87a0e5185..deac2e89d176 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -37,7 +37,8 @@ void fscache_enqueue_operation(struct fscache_operation *op) ASSERT(op->processor != NULL); ASSERT(fscache_object_is_available(op->object)); 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); switch (op->flags & FSCACHE_OP_TYPE) { @@ -401,7 +402,8 @@ void fscache_put_operation(struct fscache_operation *op) struct fscache_cache *cache; _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); |