ANDROID: dm-bow: Pass through zero sized requests 22/317022/1
authorPaul Lawrence <paullawrence@google.com>
Thu, 22 Aug 2024 15:59:42 +0000 (08:59 -0700)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 23 Dec 2024 08:34:30 +0000 (17:34 +0900)
Zero sized requests appeared in 5.15, and break validation logic in user
space. Simply pass through, as there is no reason to handle.

aosp/3238494 enables checkpoints on ext4 in cuttlefish, get this too

With all the patches in place, run:

launch_cvd \
  -userdata_format="ext4" \
  --data_policy=always_create --blank_data_image_mb=16000

then run

atest vts_kernel_checkpoint_test

Test: atest vts_kernel_checkpoint_test passes
Bug: 210958368
Signed-off-by: Paul Lawrence <paullawrence@google.com>
[jh80.chung: Taken from Android Common Kernel repo]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I9f5613271420a533376cda1be0869b107c9a8263

kernel/dm-bow.c

index ea6cbf988695d2fc6dbfcff52c159eac2335b3d6..f8ccfad74a35a0c1c803c6ce509b9a050c30b4ea 100644 (file)
@@ -1125,6 +1125,9 @@ static int dm_bow_map(struct dm_target *ti, struct bio *bio)
        if (bio_data_dir(bio) == READ && bio->bi_iter.bi_sector != 0)
                return remap_unless_illegal_trim(bc, bio);
 
+       if (bio->bi_iter.bi_size == 0)
+               return remap_unless_illegal_trim(bc, bio);
+
        if (atomic_read(&bc->state) != COMMITTED) {
                enum state state;