mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Reviewed-by: Steve Dickson <[email protected]> Acked-by: Jeff Layton <[email protected]>
This commit is contained in:
parent
03cdd0e4b9
commit
73c04a47bf
1 changed files with 7 additions and 0 deletions
|
|
@ -365,6 +365,13 @@ int fscache_cancel_op(struct fscache_operation *op,
|
|||
wake_up_bit(&op->flags, FSCACHE_OP_WAITING);
|
||||
ret = 0;
|
||||
} else if (op->state == FSCACHE_OP_ST_IN_PROGRESS && cancel_in_progress_op) {
|
||||
ASSERTCMP(object->n_in_progress, >, 0);
|
||||
if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
|
||||
object->n_exclusive--;
|
||||
object->n_in_progress--;
|
||||
if (object->n_in_progress == 0)
|
||||
fscache_start_operations(object);
|
||||
|
||||
fscache_stat(&fscache_n_op_cancelled);
|
||||
if (do_cancel)
|
||||
do_cancel(op);
|
||||
|
|
|
|||
Loading…
Reference in a new issue