Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117015
b: refs/heads/master
c: b635b00
h: refs/heads/master
i:
  117013: 1ce1ef6
  117011: 0475213
  117007: 48be5a4
v: v3
  • Loading branch information
Milan Broz authored and Alasdair G Kergon committed Oct 21, 2008
1 parent 6003eb3 commit ca28f23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 586e80e6ee0d137c7d79fbae183bb37bc60ee97e
refs/heads/master: b635b00e0e159d858486fd899c4021d1d67757e2
7 changes: 5 additions & 2 deletions trunk/drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
BUG_ON(io->ctx.idx_out < clone->bi_vcnt);

clone->bi_sector = cc->start + io->sector;
io->sector += bio_sectors(clone);

if (async)
kcryptd_queue_io(io);
Expand All @@ -703,13 +702,14 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
int crypt_finished;
unsigned out_of_pages = 0;
unsigned remaining = io->base_bio->bi_size;
sector_t sector = io->sector;
int r;

/*
* Prevent io from disappearing until this function completes.
*/
crypt_inc_pending(io);
crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, io->sector);
crypt_convert_init(cc, &io->ctx, NULL, io->base_bio, sector);

/*
* The allocated buffers can be smaller than the whole bio,
Expand All @@ -726,6 +726,7 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
io->ctx.idx_out = 0;

remaining -= clone->bi_size;
sector += bio_sectors(clone);

crypt_inc_pending(io);
r = crypt_convert(cc, &io->ctx);
Expand All @@ -741,6 +742,8 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
*/
if (unlikely(r < 0))
break;

io->sector = sector;
}

/*
Expand Down

0 comments on commit ca28f23

Please sign in to comment.