This commit is contained in:
toninov 2025-10-12 18:38:14 +02:00
parent 4872d94ea3
commit 97bcb2a404
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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();