diff options
author | Mike Snitzer <snitzer@redhat.com> | 2013-12-03 19:16:04 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-12-03 19:16:04 -0700 |
commit | 8d30726912cb39c3a3ebde06214d54861f8fdde2 (patch) | |
tree | a9ecf8e2ae0f66af17665e8dced426940027e66e /drivers/md/dm-cache-target.c | |
parent | bc1e79acc13d70c5bb1b2a47bf0a580e6ae81fb6 (diff) |
dm cache: increment bi_remaining when bi_end_io is restored
Move the bio->bi_remaining increment into dm_unhook_bio() so the
overwrite_endio() handler works as expected.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index bf3a206abd78..7c8dd1f69ce0 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -85,6 +85,12 @@ static void dm_unhook_bio(struct dm_hook_info *h, struct bio *bio) { bio->bi_end_io = h->bi_end_io; bio->bi_private = h->bi_private; + + /* + * Must bump bi_remaining to allow bio to complete with + * restored bi_end_io. + */ + atomic_inc(&bio->bi_remaining); } /*----------------------------------------------------------------*/ @@ -765,12 +771,6 @@ static void writethrough_endio(struct bio *bio, int err) dm_unhook_bio(&pb->hook_info, bio); - /* - * Must bump bi_remaining to allow bio to complete with - * restored bi_end_io. - */ - atomic_inc(&bio->bi_remaining); - if (err) { bio_endio(bio, err); return; |