Song Liu
9922fa4c3b
md/raid5: fix oops during stripe resizing
...
commit b44c018cdf748b96b676ba09fdbc5b34fc443ada upstream.
KoWei reported crash during raid5 reshape:
[ 1032.252932] Oops: 0002 [#1 ] SMP PTI
[...]
[ 1032.252943] RIP: 0010:memcpy_erms+0x6/0x10
[...]
[ 1032.252947] RSP: 0018:ffffba1ac0c03b78 EFLAGS: 00010286
[ 1032.252949] RAX: 0000784ac0000000 RBX: ffff91bec3d09740 RCX: 0000000000001000
[ 1032.252951] RDX: 0000000000001000 RSI: ffff91be6781c000 RDI: 0000784ac0000000
[ 1032.252953] RBP: ffffba1ac0c03bd8 R08: 0000000000001000 R09: ffffba1ac0c03bf8
[ 1032.252954] R10: 0000000000000000 R11: 0000000000000000 R12: ffffba1ac0c03bf8
[ 1032.252955] R13: 0000000000001000 R14: 0000000000000000 R15: 0000000000000000
[ 1032.252958] FS: 0000000000000000(0000) GS:ffff91becf500000(0000) knlGS:0000000000000000
[ 1032.252959] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1032.252961] CR2: 0000784ac0000000 CR3: 000000031780a002 CR4: 00000000001606e0
[ 1032.252962] Call Trace:
[ 1032.252969] ? async_memcpy+0x179/0x1000 [async_memcpy]
[ 1032.252977] ? raid5_release_stripe+0x8e/0x110 [raid456]
[ 1032.252982] handle_stripe_expansion+0x15a/0x1f0 [raid456]
[ 1032.252988] handle_stripe+0x592/0x1270 [raid456]
[ 1032.252993] handle_active_stripes.isra.0+0x3cb/0x5a0 [raid456]
[ 1032.252999] raid5d+0x35c/0x550 [raid456]
[ 1032.253002] ? schedule+0x42/0xb0
[ 1032.253006] ? schedule_timeout+0x10e/0x160
[ 1032.253011] md_thread+0x97/0x160
[ 1032.253015] ? wait_woken+0x80/0x80
[ 1032.253019] kthread+0x104/0x140
[ 1032.253022] ? md_start_sync+0x60/0x60
[ 1032.253024] ? kthread_park+0x90/0x90
[ 1032.253027] ret_from_fork+0x35/0x40
This is because cache_size_mutex was unlocked too early in resize_stripes,
which races with grow_one_stripe() that grow_one_stripe() allocates a
stripe with wrong pool_size.
Fix this issue by unlocking cache_size_mutex after updating pool_size.
Cc: <stable@vger.kernel.org> # v4.4+
Reported-by: KoWei Sung <winders@amazon.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:08:45 +01:00
..
2020-10-01 13:14:27 +02:00
2020-02-11 04:34:03 -08:00
2018-06-08 11:53:14 -04:00
2017-06-09 09:27:32 -06:00
2018-06-08 11:53:14 -04:00
2017-03-07 11:30:16 -05:00
2020-03-25 08:06:07 +01:00
2019-08-29 08:28:49 +02:00
2017-11-02 11:10:55 +01:00
2018-04-30 15:40:40 -04:00
2017-03-07 13:28:31 -05:00
2020-09-09 19:04:31 +02:00
2017-03-07 13:28:31 -05:00
2017-03-07 13:28:31 -05:00
2018-06-12 16:19:22 -07:00
2017-03-07 13:28:31 -05:00
2020-03-11 14:15:05 +01:00
2019-08-25 10:48:01 +02:00
2020-06-22 09:05:28 +02:00
2019-05-25 18:23:39 +02:00
2018-04-03 15:04:10 -04:00
2019-12-05 09:20:36 +01:00
2020-07-29 10:16:59 +02:00
2018-06-05 08:47:43 -06:00
2018-11-13 11:08:49 -08:00
2019-08-29 08:28:55 +02:00
2019-01-26 09:32:42 +01:00
2018-05-30 15:33:32 -06:00
2019-07-03 13:14:45 +02:00
2020-06-25 15:32:49 +02:00
2018-01-29 13:44:58 -05:00
2019-01-26 09:32:42 +01:00
2019-12-05 09:20:37 +01:00
2018-06-12 18:28:00 -07:00
2017-02-17 00:54:09 -05:00
2020-08-21 11:05:35 +02:00
2017-08-28 10:23:28 -04:00
2018-01-29 13:44:58 -05:00
2020-01-23 08:21:29 +01:00
2019-11-06 13:05:11 +01:00
2018-06-12 16:19:22 -07:00
2017-11-02 11:10:55 +01:00
2018-05-22 23:18:31 -07:00
2018-06-12 16:19:22 -07:00
2019-08-29 08:28:56 +02:00
2019-09-16 08:22:12 +02:00
2020-09-09 19:04:31 +02:00
2019-01-31 08:14:38 +01:00
2019-04-05 22:32:59 +02:00
2019-01-26 09:32:42 +01:00
2020-05-06 08:13:28 +02:00
2018-05-30 15:33:32 -06:00
2019-07-21 09:03:08 +02:00
2018-04-03 15:04:29 -04:00
2020-09-09 19:04:31 +02:00
2017-06-09 09:27:32 -06:00
2020-06-25 15:32:58 +02:00
2020-06-25 15:32:58 +02:00
2020-07-09 09:37:12 +02:00
2019-12-17 20:34:53 +01:00
2020-07-29 10:16:59 +02:00
2018-01-17 09:16:06 -05:00
2018-06-08 11:59:51 -04:00
2018-06-08 11:59:51 -04:00
2020-11-05 11:08:43 +01:00
2018-08-01 15:49:39 -07:00
2020-08-19 08:14:51 +02:00
2017-11-02 11:10:55 +01:00
2018-05-30 15:33:32 -06:00
2019-12-17 20:34:55 +01:00
2017-11-14 16:07:26 -08:00
2019-12-17 20:34:55 +01:00
2018-05-30 15:33:32 -06:00
2020-06-25 15:33:10 +02:00
2019-12-17 20:34:55 +01:00
2020-06-25 15:33:10 +02:00
2019-10-05 13:10:12 +02:00
2017-11-02 11:10:55 +01:00
2020-01-09 10:18:57 +01:00
2018-05-30 15:33:32 -06:00
2019-02-06 17:30:16 +01:00
2018-08-31 17:38:09 -07:00
2018-05-30 15:33:32 -06:00
2020-11-05 11:08:45 +01:00
2018-06-09 12:01:36 -07:00
2019-12-17 20:34:55 +01:00
2018-05-30 15:33:32 -06:00