diff options
author | NeilBrown <neilb@suse.de> | 2014-08-17 23:56:38 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-08-19 03:20:27 -0400 |
commit | ce0b0a46955d1bb389684a2605dbcaa990ba0154 (patch) | |
tree | 70f9d9eeecb0cb9eb4fa69b2d161a2ab72c7e5e4 /drivers/md | |
parent | 9c4bdf697c39805078392d5ddbbba5ae5680e0dd (diff) |
md/raid10: fix memory leak when reshaping a RAID10.
raid10 reshape clears unwanted bits from a bio->bi_flags using
a method which, while clumsy, worked until 3.10 when BIO_OWNS_VEC
was added.
Since then it clears that bit but shouldn't. This results in a
memory leak.
So change to used the approved method of clearing unwanted bits.
As this causes a memory leak which can consume all of memory
the fix is suitable for -stable.
Fixes: a38352e0ac02dbbd4fa464dc22d1352b5fbd06fd
Cc: stable@vger.kernel.org (v3.10+)
Reported-by: mdraid.pkoch@dfgh.net (Peter Koch)
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid10.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b08c18871323..d9073a10f2f2 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -4410,7 +4410,7 @@ read_more: | |||
4410 | read_bio->bi_private = r10_bio; | 4410 | read_bio->bi_private = r10_bio; |
4411 | read_bio->bi_end_io = end_sync_read; | 4411 | read_bio->bi_end_io = end_sync_read; |
4412 | read_bio->bi_rw = READ; | 4412 | read_bio->bi_rw = READ; |
4413 | read_bio->bi_flags &= ~(BIO_POOL_MASK - 1); | 4413 | read_bio->bi_flags &= (~0UL << BIO_RESET_BITS); |
4414 | read_bio->bi_flags |= 1 << BIO_UPTODATE; | 4414 | read_bio->bi_flags |= 1 << BIO_UPTODATE; |
4415 | read_bio->bi_vcnt = 0; | 4415 | read_bio->bi_vcnt = 0; |
4416 | read_bio->bi_iter.bi_size = 0; | 4416 | read_bio->bi_iter.bi_size = 0; |