Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98801
b: refs/heads/master
c: 872ac87
h: refs/heads/master
i:
  98799: 10b0c61
v: v3
  • Loading branch information
Herbert Xu committed Jul 10, 2008
1 parent fc4725c commit 7f11882
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2283af5b0b99565f516eacd756df2b1ddf9f4f85
refs/heads/master: 872ac8743cb400192a9fce4ba2d3ffd7bb309685
10 changes: 8 additions & 2 deletions trunk/crypto/chainiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7f11882

Please sign in to comment.