Patch "dm array: fix unreleased btree blocks on closing a faulty array cursor" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dm array: fix unreleased btree blocks on closing a faulty array cursor

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dm-array-fix-unreleased-btree-blocks-on-closing-a-fa.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 70723a33c2b21a306a370ba6f122d2e085560ec3
Author: Ming-Hung Tsai <mtsai@xxxxxxxxxx>
Date:   Thu Dec 5 19:41:52 2024 +0800

    dm array: fix unreleased btree blocks on closing a faulty array cursor
    
    [ Upstream commit 626f128ee9c4133b1cfce4be2b34a1508949370e ]
    
    The cached block pointer in dm_array_cursor might be NULL if it reaches
    an unreadable array block, or the array is empty. Therefore,
    dm_array_cursor_end() should call dm_btree_cursor_end() unconditionally,
    to prevent leaving unreleased btree blocks.
    
    This fix can be verified using the "array_cursor/iterate/empty" test
    in dm-unit:
      dm-unit run /pdata/array_cursor/iterate/empty --kernel-dir <KERNEL_DIR>
    
    Signed-off-by: Ming-Hung Tsai <mtsai@xxxxxxxxxx>
    Fixes: fdd1315aa5f0 ("dm array: introduce cursor api")
    Reviewed-by: Joe Thornber <thornber@xxxxxxxxxx>
    Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/persistent-data/dm-array.c b/drivers/md/persistent-data/dm-array.c
index de303ba33857..788a31cae187 100644
--- a/drivers/md/persistent-data/dm-array.c
+++ b/drivers/md/persistent-data/dm-array.c
@@ -960,10 +960,10 @@ EXPORT_SYMBOL_GPL(dm_array_cursor_begin);
 
 void dm_array_cursor_end(struct dm_array_cursor *c)
 {
-	if (c->block) {
+	if (c->block)
 		unlock_ablock(c->info, c->block);
-		dm_btree_cursor_end(&c->cursor);
-	}
+
+	dm_btree_cursor_end(&c->cursor);
 }
 EXPORT_SYMBOL_GPL(dm_array_cursor_end);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux