fscache_submit_exclusive_op() adds an operation to the pending list if other operations are pending. Fixed the check for pending ops. Added some missing debug function exit messages. Signed-off-by: Akshat Aranya <aranya@xxxxxxxxxxxx> --- fs/fscache/cache.c | 4 +++- fs/fscache/object.c | 1 + fs/fscache/operation.c | 6 ++++-- fs/fscache/page.c | 8 ++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c index 6a3c48a..64fe4b0 100644 --- a/fs/fscache/cache.c +++ b/fs/fscache/cache.c @@ -153,8 +153,10 @@ struct fscache_cache *fscache_select_cache_for_object( return NULL; } - if (test_bit(FSCACHE_IOERROR, &tag->cache->flags)) + if (test_bit(FSCACHE_IOERROR, &tag->cache->flags)) { + _leave(" = NULL [io error]"); return NULL; + } _leave(" = %p [specific]", tag->cache); return tag->cache; diff --git a/fs/fscache/object.c b/fs/fscache/object.c index 0b589a9..97abab1 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c @@ -403,6 +403,7 @@ static void fscache_initialise_object(struct fscache_object *object) spin_lock(&object->lock); object->state = FSCACHE_OBJECT_ABORT_INIT; spin_unlock(&object->lock); + _leave(""); return; } diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index f17ceca..160b805 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c @@ -105,7 +105,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); @@ -336,8 +336,10 @@ void fscache_put_operation(struct fscache_operation *op) ASSERTCMP(atomic_read(&op->usage), >, 0); - if (!atomic_dec_and_test(&op->usage)) + if (!atomic_dec_and_test(&op->usage)) { + _leave(" [active]"); return; + } fscache_set_op_state(op, "Put"); diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 47aefd3..89eb429 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c @@ -505,8 +505,10 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie, return -ERESTARTSYS; op = fscache_alloc_retrieval(mapping, end_io_func, context); - if (!op) + if (!op) { + _leave(" = -ENOMEM"); return -ENOMEM; + } fscache_set_op_name(&op->op, "RetrRAN"); spin_lock(&cookie->lock); @@ -607,8 +609,10 @@ int __fscache_alloc_page(struct fscache_cookie *cookie, return -ERESTARTSYS; op = fscache_alloc_retrieval(page->mapping, NULL, NULL); - if (!op) + if (!op) { + _leave(" = -ENOMEM"); return -ENOMEM; + } fscache_set_op_name(&op->op, "RetrAL1"); spin_lock(&cookie->lock); -- 1.5.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html