From 7f11882c93b09c2493566d4fb73bee59ef85b26a Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 10 Jul 2008 17:42:36 +0800 Subject: [PATCH] --- yaml --- r: 98801 b: refs/heads/master c: 872ac8743cb400192a9fce4ba2d3ffd7bb309685 h: refs/heads/master i: 98799: 10b0c615fc20ff61c940465d32302773415f9a84 v: v3 --- [refs] | 2 +- trunk/crypto/chainiv.c | 10 ++++++++-- trunk/drivers/md/raid5.c | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 5a917175250a..9f501cac5dc9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2283af5b0b99565f516eacd756df2b1ddf9f4f85 +refs/heads/master: 872ac8743cb400192a9fce4ba2d3ffd7bb309685 diff --git a/trunk/crypto/chainiv.c b/trunk/crypto/chainiv.c index 6da3f577e4db..9affadee3287 100644 --- a/trunk/crypto/chainiv.c +++ b/trunk/crypto/chainiv.c @@ -117,6 +117,7 @@ static int chainiv_init(struct crypto_tfm *tfm) static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) { int queued; + int err = ctx->err; if (!ctx->queue.qlen) { smp_mb__before_clear_bit(); @@ -131,7 +132,7 @@ static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) BUG_ON(!queued); out: - return ctx->err; + return err; } static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) @@ -227,6 +228,7 @@ static void async_chainiv_do_postponed(struct work_struct *work) postponed); struct skcipher_givcrypt_request *req; struct ablkcipher_request *subreq; + int err; /* Only handle one request at a time to avoid hogging keventd. */ spin_lock_bh(&ctx->lock); @@ -241,7 +243,11 @@ static void async_chainiv_do_postponed(struct work_struct *work) subreq = skcipher_givcrypt_reqctx(req); subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; - async_chainiv_givencrypt_tail(req); + err = async_chainiv_givencrypt_tail(req); + + local_bh_disable(); + skcipher_givcrypt_complete(req, err); + local_bh_enable(); } static int async_chainiv_init(struct crypto_tfm *tfm) diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 3b27df52456b..54c8ee28fcc4 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -2017,7 +2017,12 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh, */ s->uptodate++; return 0; /* uptodate + compute == disks */ - } else if (test_bit(R5_Insync, &dev->flags)) { + } else if ((s->uptodate < disks - 1) && + test_bit(R5_Insync, &dev->flags)) { + /* Note: we hold off compute operations while checks are + * in flight, but we still prefer 'compute' over 'read' + * hence we only read if (uptodate < * disks-1) + */ set_bit(R5_LOCKED, &dev->flags); set_bit(R5_Wantread, &dev->flags); if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending))