dm-crypt - submit a bio synchronously

sandeep kiran p <[email protected]> Sat, 20 Aug 2022 07:35:28 -0400
Newsgroups gmane.linux.newbie
Message-ID <CAAxGnDA9Hnav=UMVd+xYjJ7tZFYnCYpPF8kGT3naSnuBB04bGw@mail.gmail.com>
dm-crypt.c has calls to dm_submit_bio_remap to submit a bio
asynchronously to the underlying layer device. I have a requirement
for synchronous submission of a bio. When I used submit_bio_wait, the
call just hangs forever. If I set REQ_SYNC in bio->bi_opf and set both
bio->bi_private and bio->bi_end_io to NULL (indicating no callback),
and then use dm_submit_bio_remap , I get an OOPS with null pointer
dereference.

Can you help me with a proper way to submit the bio synchronously
inside dm-crypt.c?