mirror of
https://codeberg.org/shufflecake/shufflecake-c.git
synced 2025-12-27 22:24:56 -05:00
Bugfix
This commit is contained in:
parent
4872d94ea3
commit
97bcb2a404
2 changed files with 6 additions and 4 deletions
|
|
@ -193,6 +193,7 @@ static int issue_lowlevel_flush(struct sflite_volume *svol, struct bio *orig_bio
|
|||
{
|
||||
struct bio *clone;
|
||||
DECLARE_COMPLETION_ONSTACK(compl);
|
||||
int err = 0;
|
||||
|
||||
// Can either issue a brand-new request
|
||||
if (orig_bio == NULL)
|
||||
|
|
@ -209,9 +210,10 @@ static int issue_lowlevel_flush(struct sflite_volume *svol, struct bio *orig_bio
|
|||
// Submit and wait
|
||||
dm_submit_bio_remap(orig_bio, clone);
|
||||
wait_for_completion_io(&compl);
|
||||
err = blk_status_to_errno(orig_bio->bi_status);
|
||||
|
||||
bio_put(clone);
|
||||
return blk_status_to_errno(orig_bio->bi_status);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -314,8 +316,8 @@ int sflite_flush_posmap(struct sflite_volume *svol, struct bio *orig_bio, gfp_t
|
|||
* of the posmap blocks: those whose CWB did not fail, and whose seqnum
|
||||
* did not change while we were not holding the locks.
|
||||
* If some CWBs failed, we return an error (then failing the upper-layer
|
||||
* bio in the caller, if there is one), but that doesn't mean aborting
|
||||
* entirely, because we can still mark some blocks as clean.
|
||||
* bio in the caller), but that doesn't mean aborting entirely, because
|
||||
* we can still mark some blocks as clean.
|
||||
* Here, we need to lock again. */
|
||||
down_write(&svol->posmap.flush_lock); // Not killable, for simplicity
|
||||
err = mark_posmap_blocks_clean(svol);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ fn flush():
|
|||
|
||||
rwsem.down_write();
|
||||
// Some blocks might be marked clean, some might not; the overall FLUSH
|
||||
// operation is successful only if all previously-dirty blocks are marked clean
|
||||
// operation is successful only if all CWBs were successful
|
||||
err = mark_blocks_clean();
|
||||
rwsem.up_write();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue