diff options
author | David Howells <dhowells@redhat.com> | 2015-02-25 09:07:25 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2015-04-02 09:28:53 -0400 |
commit | 73c04a47bf79770fbe7f3cf515f5831fccab88ee (patch) | |
tree | c1356f4638ab71ae1f9490c2957b0e23d5e0de85 /fs/fscache | |
parent | 03cdd0e4b9a98ae995b81cd8f58e992ec3f44ae2 (diff) |
FS-Cache: Fix cancellation of in-progress operation
Cancellation of an in-progress operation needs to update the relevant counters
and start any operations that are pending waiting on this one.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Steve Dickson <steved@redhat.com>
Acked-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r-- | fs/fscache/operation.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index 9761df4fc2ab..b6bf5f399d70 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c | |||
@@ -365,6 +365,13 @@ int fscache_cancel_op(struct fscache_operation *op, | |||
365 | wake_up_bit(&op->flags, FSCACHE_OP_WAITING); | 365 | wake_up_bit(&op->flags, FSCACHE_OP_WAITING); |
366 | ret = 0; | 366 | ret = 0; |
367 | } else if (op->state == FSCACHE_OP_ST_IN_PROGRESS && cancel_in_progress_op) { | 367 | } else if (op->state == FSCACHE_OP_ST_IN_PROGRESS && cancel_in_progress_op) { |
368 | ASSERTCMP(object->n_in_progress, >, 0); | ||
369 | if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) | ||
370 | object->n_exclusive--; | ||
371 | object->n_in_progress--; | ||
372 | if (object->n_in_progress == 0) | ||
373 | fscache_start_operations(object); | ||
374 | |||
368 | fscache_stat(&fscache_n_op_cancelled); | 375 | fscache_stat(&fscache_n_op_cancelled); |
369 | if (do_cancel) | 376 | if (do_cancel) |
370 | do_cancel(op); | 377 | do_cancel(op); |