Patch "dm log writes: move IO accounting earlier to fix error path" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
dm log writes: move IO accounting earlier to fix error path
to the 4.4-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-log-writes-move-io-accounting-earlier-to-fix-error-path.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
a5d60783df61fbb67b7596b8a0f6b4b2e05251d5Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <[email protected]>
Date: Tue, 30 Aug 2016 16:11:53 -0400
Subject: dm log writes: move IO accounting earlier to fix error path
From: Mikulas Patocka <[email protected]>
commit a5d60783df61fbb67b7596b8a0f6b4b2e05251d5 upstream.
Move log_one_block()'s atomic_inc(&lc->io_blocks) before bio_alloc() to fix a bug that the target hangs if bio_alloc() fails. The error path does put_io_block(lc), so atomic_inc(&lc->io_blocks) must occur before invoking the error path to avoid underflow of lc->io_blocks.
--- drivers/md/dm-log-writes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-log-writes.c +1 -1
@@ -258,12 +258,12 @@ static int log_one_block(struct log_writ goto out; sector++; +atomic_inc (&lc->io_blocks); bio =bio_alloc (GFP_KERNEL , block->vec_cnt);if (!bio) {DMERR ("Couldn't alloc log bio" ); goto error; } -atomic_inc (&lc->io_blocks); bio->bi_iter.bi_size =0 ; bio->bi_iter.bi_sector = sector; bio->bi_bdev = lc->logdev->bdev;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/dm-crypt-fix-error-with-too-large-bios.patch queue-4.4/dm-log-writes-move-io-accounting-earlier-to-fix-error-path.patch