Skip to contentSkip to conversation

FS-Cache: Fix operation handling

PATCH New David Howells 1 participant 1 message Jan 14, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FS-Cache: Fix operation handling

From: Akshat Aranya <[email protected]>

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.

---

 fs/fscache/operation.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/fscache/operation.c +1 -1
index b9f34ea..48a18f1 100644
@@ -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);