diff options
author | NeilBrown <neilb@suse.de> | 2014-08-18 13:56:38 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-17 09:04:00 -0700 |
commit | 1075d2bdf6334b8373c00978403a69a4d9fdb883 (patch) | |
tree | 51adeb847892f8d10858bdd1e3b16da248f91879 | |
parent | 318a3d59cea8f6790a364f4f8ab24a7aa9514ada (diff) | |
download | lwn-1075d2bdf6334b8373c00978403a69a4d9fdb883.tar.gz lwn-1075d2bdf6334b8373c00978403a69a4d9fdb883.zip |
md/raid10: fix memory leak when reshaping a RAID10.
commit ce0b0a46955d1bb389684a2605dbcaa990ba0154 upstream.
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
Reported-by: mdraid.pkoch@dfgh.net (Peter Koch)
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 d2f8cd332b4a..973e26fc18c1 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4398,7 +4398,7 @@ read_more: read_bio->bi_private = r10_bio; read_bio->bi_end_io = end_sync_read; read_bio->bi_rw = READ; - read_bio->bi_flags &= ~(BIO_POOL_MASK - 1); + read_bio->bi_flags &= (~0UL << BIO_RESET_BITS); read_bio->bi_flags |= 1 << BIO_UPTODATE; read_bio->bi_vcnt = 0; read_bio->bi_size = 0; |