From: Akshat Aranya Date: Fri, 14 Jan 2011 16:00:47 +0000 (+0000) Subject: FS-Cache: Fix operation handling X-Git-Tag: MMI-PSA29.97-13-9~21029 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ba28b93a5227cc69ec811507f7d85ac25fa20fe2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git FS-Cache: Fix operation handling fscache_submit_exclusive_op() adds an operation to the pending list if other operations are pending. Fix the check for pending ops as n_ops must be greater than 0 at the point it is checked as it is incremented immediately before under lock. Signed-off-by: Akshat Aranya Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index b9f34eaede09..48a18f184d50 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -101,7 +101,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object, object->n_ops++; object->n_exclusive++; /* reads and writes must wait */ - if (object->n_ops > 0) { + if (object->n_ops > 1) { atomic_inc(&op->usage); list_add_tail(&op->pend_link, &object->pending_ops); fscache_stat(&fscache_n_op_pend);