1. 09 Oct, 2020 7 commits
    • Jens Axboe's avatar
      Merge branch 'md-next' of... · 79cd1668
      Jens Axboe authored
      Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.10/drivers
      
      Pull MD updates from Song:
      
      "The main changes are:
       - Bug fixes in bitmap code, from Zhao Heming.
       - Fix a work queue check, from Guoqing Jiang.
       - Fix raid5 oops with reshape, from Song Liu.
       - Clean up unused code, from Jason Yan."
      
      * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
        md/raid5: fix oops during stripe resizing
        md/bitmap: fix memory leak of temporary bitmap
        md: fix the checking of wrong work queue
        md/bitmap: md_bitmap_get_counter returns wrong blocks
        md/bitmap: md_bitmap_read_sb uses wrong bitmap blocks
        md/raid0: remove unused function is_io_in_chunk_boundary()
      79cd1668
    • Song Liu's avatar
      md/raid5: fix oops during stripe resizing · b44c018c
      Song Liu authored
      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: default avatarKoWei Sung <winders@amazon.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      b44c018c
    • Zhao Heming's avatar
      md/bitmap: fix memory leak of temporary bitmap · 1383b347
      Zhao Heming authored
      Callers of get_bitmap_from_slot() are responsible to free the bitmap.
      Suggested-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
      Signed-off-by: default avatarZhao Heming <heming.zhao@suse.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      1383b347
    • Guoqing Jiang's avatar
      md: fix the checking of wrong work queue · cf0b9b48
      Guoqing Jiang authored
      It should check md_rdev_misc_wq instead of md_misc_wq.
      
      Fixes: cc1ffe61 ("md: add new workqueue for delete rdev")
      Cc: <stable@vger.kernel.org> # v5.8+
      Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      cf0b9b48
    • Zhao Heming's avatar
      md/bitmap: md_bitmap_get_counter returns wrong blocks · d837f727
      Zhao Heming authored
      md_bitmap_get_counter() has code:
      
      ```
          if (bitmap->bp[page].hijacked ||
              bitmap->bp[page].map == NULL)
              csize = ((sector_t)1) << (bitmap->chunkshift +
                            PAGE_COUNTER_SHIFT - 1);
      ```
      
      The minus 1 is wrong, this branch should report 2048 bits of space.
      With "-1" action, this only report 1024 bit of space.
      
      This bug code returns wrong blocks, but it doesn't inflence bitmap logic:
      1. Most callers focus this function return value (the counter of offset),
         not the parameter blocks.
      2. The bug is only triggered when hijacked is true or map is NULL.
         the hijacked true condition is very rare.
         the "map == null" only true when array is creating or resizing.
      3. Even the caller gets wrong blocks, current code makes caller just to
         call md_bitmap_get_counter() one more time.
      Signed-off-by: default avatarZhao Heming <heming.zhao@suse.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      d837f727
    • Zhao Heming's avatar
      md/bitmap: md_bitmap_read_sb uses wrong bitmap blocks · a913096d
      Zhao Heming authored
      The patched code is used to get chunks number, should use round-up div
      to replace current sector_div. The same code is in md_bitmap_resize():
      ```
      chunks = DIV_ROUND_UP_SECTOR_T(blocks, 1 << chunkshift);
      ```
      Signed-off-by: default avatarZhao Heming <heming.zhao@suse.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      a913096d
    • Jason Yan's avatar
      md/raid0: remove unused function is_io_in_chunk_boundary() · d7a1c483
      Jason Yan authored
      This function is no longger needed after commit 20d0189b ("block:
      Introduce new bio_split()").
      Signed-off-by: default avatarJason Yan <yanaijie@huawei.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      d7a1c483
  2. 08 Oct, 2020 1 commit
    • Jens Axboe's avatar
      Merge tag 'nvme-5.10-2020-10-08' of git://git.infradead.org/nvme into for-5.10/drivers · b6bf0830
      Jens Axboe authored
      Pull NVMe updates from Christoph:
      
      "nvme update for 5.10:
      
       - fix a controller refcount leak on init failure (Chaitanya Kulkarni)
       - misc cleanups (Chaitanya Kulkarni)
       - major refactoring of the scanning code (me)"
      
      * tag 'nvme-5.10-2020-10-08' of git://git.infradead.org/nvme: (23 commits)
        nvme-core: remove extra condition for vwc
        nvme-core: remove extra variable
        nvme: remove nvme_identify_ns_list
        nvme: refactor nvme_validate_ns
        nvme: move nvme_validate_ns
        nvme: query namespace identifiers before adding the namespace
        nvme: revalidate zone bitmaps in nvme_update_ns_info
        nvme: remove nvme_update_formats
        nvme: update the known admin effects
        nvme: set the queue limits in nvme_update_ns_info
        nvme: remove the 0 lba_shift check in nvme_update_ns_info
        nvme: clean up the check for too large logic block sizes
        nvme: freeze the queue over ->lba_shift updates
        nvme: factor out a nvme_configure_metadata helper
        nvme: call nvme_identify_ns as the first thing in nvme_alloc_ns_block
        nvme: lift the check for an unallocated namespace into nvme_identify_ns
        nvme: rename __nvme_revalidate_disk
        nvme: rename _nvme_revalidate_disk
        nvme: rename nvme_validate_ns to nvme_validate_or_alloc_ns
        nvme: remove the disk argument to nvme_update_zone_info
        ...
      b6bf0830
  3. 07 Oct, 2020 23 commits
  4. 06 Oct, 2020 5 commits
  5. 02 Oct, 2020 4 commits