summaryrefslogtreecommitdiffstats
path: root/fs/fscache/operation.c
diff options
context:
space:
mode:
authorAkshat Aranya <aranya@nec-labs.com>2011-01-14 16:00:47 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-14 09:23:36 -0800
commitba28b93a5227cc69ec811507f7d85ac25fa20fe2 (patch)
tree1ae3a8d6b19528277f5a622705b633a43f5218b8 /fs/fscache/operation.c
parentacda4721ae876dedab3fef04bbd8020bfa67ff0a (diff)
downloadlinux-ba28b93a5227cc69ec811507f7d85ac25fa20fe2.tar.gz
linux-ba28b93a5227cc69ec811507f7d85ac25fa20fe2.tar.bz2
linux-ba28b93a5227cc69ec811507f7d85ac25fa20fe2.zip
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 <aranya@nec-labs.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fscache/operation.c')
-rw-r--r--fs/fscache/operation.c2
1 files changed, 1 insertions, 1 deletions
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);