From f0288879c4ebee7e7540563bb2efa60f26f052fb Mon Sep 17 00:00:00 2001 From: Tommaso Gagliardoni Date: Mon, 25 Aug 2025 16:47:18 +0200 Subject: [PATCH] doc: Add comments in src files of Lite One comment is a TODO about the possibility of doing slice garbage collection dynamically instead of requiring a reload. The other is a warning about the importance of terminating a TRIM bio before it reaches the block device, otherwise plausible deniability might break. --- dm-sflc/src/lite/discard.c | 3 +++ dm-sflc/src/lite/posmap.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/dm-sflc/src/lite/discard.c b/dm-sflc/src/lite/discard.c index 172257c..d41d59b 100644 --- a/dm-sflc/src/lite/discard.c +++ b/dm-sflc/src/lite/discard.c @@ -60,6 +60,9 @@ unlock: up_read(&svol->posmap.flush_lock); /* Done */ + /* WARNING: it is crucial that the original bio is terminated here and never + reaches the block device, otherwise the effect of a TRIM on the block device + would be obvious, and likely to break plausible deniability */ bio_endio(orig_bio); return; } diff --git a/dm-sflc/src/lite/posmap.c b/dm-sflc/src/lite/posmap.c index 95c46e9..8c0b57a 100644 --- a/dm-sflc/src/lite/posmap.c +++ b/dm-sflc/src/lite/posmap.c @@ -127,6 +127,8 @@ int sflite_destroy_local_slice_mapping(struct sflite_volume *svol, u32 lsi) so the counters must remain untouched to avoid confusion. */ // sdev->nr_free_slices++; // svol->posmap.nr_mapped_slices--; + /* TODO: possible to improve by freeing up slices dynamically instead of + requiring reload/close-open? */ /* Set the dirty bit in position map */ __set_bit(lsi/SFLITE_PSIS_PER_BLOCK, svol->posmap.dirty_bitmap);