1. 16 Jun, 2024 7 commits
  2. 15 Jun, 2024 1 commit
  3. 14 Jun, 2024 30 commits
  4. 12 Jun, 2024 2 commits
    • Jens Axboe's avatar
      Merge tag 'md-6.11-20240612' of... · c2670cf7
      Jens Axboe authored
      Merge tag 'md-6.11-20240612' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.11/block
      
      Pull MD updates from Song:
      
      "The major changes in this PR are:
      
       - sync_action fix and refactoring, by Yu Kuai;
       - Various small fixes by Christoph Hellwig, Li Nan, and Ofir Gal."
      
      * tag 'md-6.11-20240612' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md:
        md/raid5: avoid BUG_ON() while continue reshape after reassembling
        md: pass in max_sectors for pers->sync_request()
        md: factor out helpers for different sync_action in md_do_sync()
        md: replace last_sync_action with new enum type
        md: use new helpers in md_do_sync()
        md: don't fail action_store() if sync_thread is not registered
        md: remove parameter check_seq for stop_sync_thread()
        md: replace sysfs api sync_action with new helpers
        md: factor out helper to start reshape from action_store()
        md: add new helpers for sync_action
        md: add a new enum type sync_action
        md: rearrange recovery_flags
        md/md-bitmap: fix writing non bitmap pages
        md/raid1: don't free conf on raid0_run failure
        md/raid0: don't free conf on raid0_run failure
        md: make md_flush_request() more readable
        md: fix deadlock between mddev_suspend and flush bio
        md: change the return value type of md_write_start to void
        md: do not delete safemode_timer in mddev_suspend
      c2670cf7
    • Yu Kuai's avatar
      md/raid5: avoid BUG_ON() while continue reshape after reassembling · 305a5170
      Yu Kuai authored
      Currently, mdadm support --revert-reshape to abort the reshape while
      reassembling, as the test 07revert-grow. However, following BUG_ON()
      can be triggerred by the test:
      
      kernel BUG at drivers/md/raid5.c:6278!
      invalid opcode: 0000 [#1] PREEMPT SMP PTI
      irq event stamp: 158985
      CPU: 6 PID: 891 Comm: md0_reshape Not tainted 6.9.0-03335-g7592a0b0049a #94
      RIP: 0010:reshape_request+0x3f1/0xe60
      Call Trace:
       <TASK>
       raid5_sync_request+0x43d/0x550
       md_do_sync+0xb7a/0x2110
       md_thread+0x294/0x2b0
       kthread+0x147/0x1c0
       ret_from_fork+0x59/0x70
       ret_from_fork_asm+0x1a/0x30
       </TASK>
      
      Root cause is that --revert-reshape update the raid_disks from 5 to 4,
      while reshape position is still set, and after reassembling the array,
      reshape position will be read from super block, then during reshape the
      checking of 'writepos' that is caculated by old reshape position will
      fail.
      
      Fix this panic the easy way first, by converting the BUG_ON() to
      WARN_ON(), and stop the reshape if checkings fail.
      
      Noted that mdadm must fix --revert-shape as well, and probably md/raid
      should enhance metadata validation as well, however this means
      reassemble will fail and there must be user tools to fix the wrong
      metadata.
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Signed-off-by: default avatarSong Liu <song@kernel.org>
      Link: https://lore.kernel.org/r/20240611132251.1967786-13-yukuai1@huaweicloud.com
      305a5170