Commit 1e37bb8e authored by Alasdair G Kergon's avatar Alasdair G Kergon

dm crypt: remove inc_pending from write_io_submit

Make the caller reponsible for incrementing the pending count before calling
kcryptd_crypt_write_io_submit() in the non-async case to bring it into line
with the async case.
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent fc5a5e9a
...@@ -685,10 +685,8 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io, ...@@ -685,10 +685,8 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
if (async) if (async)
kcryptd_queue_io(io); kcryptd_queue_io(io);
else { else
crypt_inc_pending(io);
generic_make_request(clone); generic_make_request(clone);
}
} }
static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
...@@ -724,9 +722,12 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) ...@@ -724,9 +722,12 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
if (atomic_dec_and_test(&io->ctx.pending)) { if (atomic_dec_and_test(&io->ctx.pending)) {
/* processed, no running async crypto */ /* processed, no running async crypto */
crypt_inc_pending(io);
kcryptd_crypt_write_io_submit(io, r, 0); kcryptd_crypt_write_io_submit(io, r, 0);
if (unlikely(r < 0)) if (unlikely(r < 0)) {
crypt_dec_pending(io);
break; break;
}
} else } else
crypt_inc_pending(io); crypt_inc_pending(io);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment