stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "md/raid5: don't record new size if resize_stripes fails." has been added to the 3.14-stable tree
@ 2015-06-03  5:27 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-06-03  5:27 UTC (permalink / raw)
  To: neilb, gregkh; +Cc: stable, stable-commits


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

    md/raid5: don't record new size if resize_stripes fails.

to the 3.14-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:
     md-raid5-don-t-record-new-size-if-resize_stripes-fails.patch
and it can be found in the queue-3.14 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 6e9eac2dcee5e19f125967dd2be3e36558c42fff Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Fri, 8 May 2015 18:19:34 +1000
Subject: md/raid5: don't record new size if resize_stripes fails.

From: NeilBrown <neilb@suse.de>

commit 6e9eac2dcee5e19f125967dd2be3e36558c42fff upstream.

If any memory allocation in resize_stripes fails we will return
-ENOMEM, but in some cases we update conf->pool_size anyway.

This means that if we try again, the allocations will be assumed
to be larger than they are, and badness results.

So only update pool_size if there is no error.

This bug was introduced in 2.6.17 and the patch is suitable for
-stable.

Fixes: ad01c9e3752f ("[PATCH] md: Allow stripes to be expanded in preparation for expanding an array")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/raid5.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1914,7 +1914,8 @@ static int resize_stripes(struct r5conf
 
 	conf->slab_cache = sc;
 	conf->active_name = 1-conf->active_name;
-	conf->pool_size = newsize;
+	if (!err)
+		conf->pool_size = newsize;
 	return err;
 }
 


Patches currently in stable-queue which might be from neilb@suse.de are

queue-3.14/md-raid5-don-t-record-new-size-if-resize_stripes-fails.patch
queue-3.14/md-raid0-fix-restore-to-sector-variable-in-raid0_make_request.patch

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

only message in thread, other threads:[~2015-06-03  5:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03  5:27 Patch "md/raid5: don't record new size if resize_stripes fails." has been added to the 3.14-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).