<div dir="ltr"><div>We hit a RAID 5 issue during failure testing that caused a flood of kernel warnings and minor but problematic data corruption. </div><div><br></div><div>Setup: RAID 5 with 7 drives + 1 hot spare </div><div>OS: RHEL 7.5</div><div>Kernel: linux-3.10.0-862.3.3.el7</div><div><br></div><div>Scenario: We pulled a single data drive and the array automatically started its recovery process using the hot spare. We immediately became overwhelmed with the following kernel messages which choked the system.  Setting kernel.printk="2 4 1 7" did nothing to stop the messages. Once the repair was complete the machine became usable again. Once we were online again we noticed we had some minor data corruption.</div><div><br></div><div>We have been unable to reproduce this issue again.</div><div><br></div><div><div>[258091.028244] Workqueue: raid5wq raid5_do_work [raid456]</div><div>[258091.028245] Call Trace:</div><div>[258091.028248]  [<ffffffff9fb0e78e>] dump_stack+0x19/0x1b</div><div>[258091.028250]  [<ffffffff9f491998>] __warn+0xd8/0x100</div><div>[258091.028253]  [<ffffffff9f491add>] warn_slowpath_null+0x1d/0x20</div><div>[258091.028257]  [<ffffffffc0834677>] handle_stripe+0x2367/0x23f0 [raid456]</div><div>[258091.028258] systemd-journald[166084]: /dev/kmsg buffer overrun, some messages lost.</div><div>[258091.028262]  [<ffffffff9f72bad1>] ? blk_mq_sched_dispatch_requests+0x181/0x1c0</div><div>[258091.028266]  [<ffffffffc0834aad>] handle_active_stripes.isra.55+0x3ad/0x530 [raid456]</div><div>[258091.028271]  [<ffffffffc08354bf>] raid5_do_work+0x9f/0x150 [raid456]</div><div>[258091.028271] systemd-journald[166084]: /dev/kmsg buffer overrun, some messages lost.</div><div>[258091.028274]  [<ffffffff9f4b312f>] process_one_work+0x17f/0x440</div><div>[258091.028276]  [<ffffffff9f4b3df6>] worker_thread+0x126/0x3c0</div><div>[258091.028279]  [<ffffffff9f4b3cd0>] ? manage_workers.isra.24+0x2a0/0x2a0</div><div>[258091.028280]  [<ffffffff9f4bb161>] kthread+0xd1/0xe0</div><div>[258091.028281] systemd-journald[166084]: /dev/kmsg buffer overrun, some messages lost.</div><div>[258091.028284]  [<ffffffff9f4bb090>] ? insert_kthread_work+0x40/0x40</div><div>[258091.028287]  [<ffffffff9fb2065d>] ret_from_fork_nospec_begin+0x7/0x21</div><div>[258091.028290]  [<ffffffff9f4bb090>] ? insert_kthread_work+0x40/0x40</div><div>[258091.028291] systemd-journald[166084]: /dev/kmsg buffer overrun, some messages lost.</div><div>[258091.028292] ---[ end trace 3232975a123b52bf ]---</div><div>[258091.028297] ------------[ cut here ]------------</div><div>[258091.028301] <b>WARNING: CPU: 4 PID: 155463 at drivers/md/raid5.c:4672</b> handle_stripe+0x2367/0x23f0 [raid456]</div></div><div><br></div><div><div># cat /proc/mdstat </div><div>Personalities : [raid6] [raid5] [raid4] [raid0] </div><div>md126 : active raid0 md127[0]</div><div>      4657247232 blocks super 1.2 512k chunks</div><div>      </div><div>md127 : active raid5 dm-7[7](R) dm-6[6](F) dm-5[5] dm-4[4] dm-3[3] dm-2[2] dm-1[1] dm-0[0]</div><div>      4657379328 blocks super 1.2 level 5, 16k chunk, algorithm 2 [7/6] [UUUUUU_]</div><div>      [=>...................]  recovery =  9.6% (75100712/776229888) finish=601.8min speed=19414K/sec</div><div>      bitmap: 1/6 pages [4KB], 65536KB chunk</div><div><br></div><div>unused devices: <none></div></div><div><br></div><div><b>drivers/md/raid5.c:4672</b><br></div><div><b><br></b></div><div>    /* maybe we need to check and possibly fix the parity for this stripe</div><div>     * Any reads will already have been scheduled, so we just see if enough</div><div>     * data is available.  The parity check is held off while parity</div><div>     * dependent operations are in flight.</div><div>     */</div><div>    if (sh->check_state ||</div><div>        (s.syncing && s.locked == 0 &&</div><div>         !test_bit(STRIPE_COMPUTE_RUN, &sh->state) &&</div><div>         !test_bit(STRIPE_INSYNC, &sh->state))) {</div><div>        if (conf->level == 6)</div><div>            handle_parity_checks6(conf, sh, &s, disks);</div><div>        else</div><div>            handle_parity_checks5(conf, sh, &s, disks);</div><div>    }</div><div><br></div><div>    if ((s.replacing || s.syncing) && s.locked == 0</div><div>        && !test_bit(STRIPE_COMPUTE_RUN, &sh->state)</div><div>        && !test_bit(STRIPE_REPLACED, &sh->state)) {</div><div>        /* Write out to replacement devices where possible */</div><div>        for (i = 0; i < conf->raid_disks; i++)</div><div>            if (test_bit(R5_NeedReplace, &sh->dev[i].flags)) {</div><div>                <b>WARN_ON(!test_bit(R5_UPTODATE, &sh->dev[i].flags));</b></div><div>                set_bit(R5_WantReplace, &sh->dev[i].flags);</div><div>                set_bit(R5_LOCKED, &sh->dev[i].flags);</div><div>                s.locked++;</div><div>            }</div><div>        if (s.replacing)</div><div>            set_bit(STRIPE_INSYNC, &sh->state);</div><div>        set_bit(STRIPE_REPLACED, &sh->state);</div><div>    }</div><div><br></div></div>