stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "dm log writes: move IO accounting earlier to fix error path" has been added to the 4.7-stable tree
@ 2016-09-22 13:34 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-22 13:34 UTC (permalink / raw)
  To: mpatocka, gregkh, jbacik, snitzer; +Cc: stable, stable-commits


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.7-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.7 subdirectory.

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


>From a5d60783df61fbb67b7596b8a0f6b4b2e05251d5 Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <mpatocka@redhat.com>
Date: Tue, 30 Aug 2016 16:11:53 -0400
Subject: dm log writes: move IO accounting earlier to fix error path

From: Mikulas Patocka <mpatocka@redhat.com>

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.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Josef Bacik <jbacik@fb,com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/dm-log-writes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/dm-log-writes.c
+++ b/drivers/md/dm-log-writes.c
@@ -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 mpatocka@redhat.com are

queue-4.7/dm-crypt-fix-error-with-too-large-bios.patch
queue-4.7/dm-log-writes-move-io-accounting-earlier-to-fix-error-path.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-22 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 13:34 Patch "dm log writes: move IO accounting earlier to fix error path" has been added to the 4.7-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).