fix: Undefine BLK_STS_INVAL

This symbol seems to be only supported in recent kernels, so remvoing it for now to allow compilation on older kernels
This commit is contained in:
Tommaso Gagliardoni 2025-09-06 20:52:49 +02:00
parent 5b0d030780
commit b253a92cba

View file

@ -137,7 +137,7 @@ static int sflite_map(struct dm_target *ti, struct bio *bio)
if (unlikely(bio->bi_iter.bi_size != SFLITE_BLOCK_SIZE * SFLITE_SLICE_SCALE)) {
DMINFO("Wrong discard bio size: %u", bio->bi_iter.bi_size);
// TODO investigate where these are coming from
bio->bi_status = BLK_STS_INVAL;
//bio->bi_status = BLK_STS_INVAL; // BUG: this only seems to work on recent (>6.8) kernels
bio_endio(bio);
return DM_MAPIO_SUBMITTED;
}
@ -145,7 +145,7 @@ static int sflite_map(struct dm_target *ti, struct bio *bio)
/* Ensure the logical block number is aligned with the beginning of a slice */
if (unlikely(lblk_num % SFLITE_SLICE_SCALE != 0)) {
DMWARN("Unaligned discard bio!");
bio->bi_status = BLK_STS_INVAL;
//bio->bi_status = BLK_STS_INVAL; // BUG: this only seems to work on recent (>6.8) kernels
bio_endio(bio);
return DM_MAPIO_SUBMITTED;
}