dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Yu Kuai <yukuai3@huawei.com>, Song Liu <song@kernel.org>,
	 David Jeffery <djeffery@redhat.com>,
	Li Nan <linan122@huawei.com>
Cc: dm-devel@lists.linux.dev, linux-raid@vger.kernel.org,
	 Mike Snitzer <msnitzer@redhat.com>,
	Heinz Mauelshagen <heinzm@redhat.com>,
	 Benjamin Marzinski <bmarzins@redhat.com>
Subject: [PATCH 6/7] md: partially revert "md/raid6: use valid sector values to determine if an I/O should wait on the reshape"
Date: Wed, 17 Jan 2024 19:22:05 +0100 (CET)	[thread overview]
Message-ID: <b725da99-d649-6f1d-af82-c3e482f7f6e@redhat.com> (raw)
In-Reply-To: <e5e8afe2-e9a8-49a2-5ab0-958d4065c55e@redhat.com>

Revert the commit c467e97f079f ("md/raid6: use valid sector values to
determine if an I/O should wait on the reshape") - it causes deadlock in
the LVM2 test shell/lvconvert-raid-reshape.sh

sysrq: Show Blocked State
task:(udev-worker)   state:D stack:0     pid:98633 tgid:98633 ppid:320    flags:0x00000006
Call Trace:
 <TASK>
 __schedule+0x213/0x550
 schedule+0x29/0xa0
 schedule_timeout+0xbe/0xd0
 ? __wake_up+0x3b/0x50
 wait_woken+0x47/0x50
 raid5_make_request+0x501/0x10e0 [raid456]
 ? swake_up_all+0xb0/0xb0
 md_handle_request+0x132/0x1e0 [md_mod]
 raid_map+0x20/0x30 [dm_raid]
 __map_bio+0x179/0x1a0 [dm_mod]
 dm_submit_bio+0x166/0x4c0 [dm_mod]
 __submit_bio+0x78/0xf0
 submit_bio_noacct_nocheck+0xb6/0x290
 mpage_readahead+0xc7/0xe0
 ? blkdev_iomap_begin+0x80/0x80
 read_pages+0x42/0x1e0
 page_cache_ra_unbounded+0x128/0x170
 force_page_cache_ra+0x8c/0xb0
 filemap_get_pages+0xf3/0x530
 ? current_time+0x16/0xc0
 filemap_read+0xb3/0x2b0
 ? sgl_alloc_order+0xf0/0x1c0
 ? dm_copy_name_and_uuid+0x6c/0x90 [dm_mod]
 ? dm_attr_uuid_show+0x1a/0x40 [dm_mod]
 ? do_wp_page+0x20c/0xaf0
 ? dm_attr_show+0x32/0x50 [dm_mod]
 ? __pte_offset_map+0x12/0x170
 blkdev_read_iter+0x62/0x140
 vfs_read+0x1a9/0x2a0
 ksys_read+0x4e/0xc0
 do_syscall_64+0x3c/0x110
 entry_SYSCALL_64_after_hwframe+0x46/0x4e
 </TASK>
task:lvm             state:D stack:0     pid:151667 tgid:151667 ppid:150522 flags:0x00000002
Call Trace:
 <TASK>
 __schedule+0x213/0x550
 schedule+0x29/0xa0
 schedule_timeout+0xbe/0xd0
 ? queue_delayed_work_on+0x1b/0x30
 ? srcu_gp_start_if_needed+0x33e/0x4a0
 wait_for_completion+0x6d/0x110
 __synchronize_srcu.part.0+0x6f/0x80
 ? get_rcu_tasks_trace_gp_kthread+0x10/0x10
 __dm_suspend+0x50/0x180 [dm_mod]
 ? table_deps+0x1b0/0x1b0 [dm_mod]
 dm_suspend+0xaf/0xd0 [dm_mod]
 dev_suspend+0x186/0x2d0 [dm_mod]
 ? table_deps+0x1b0/0x1b0 [dm_mod]
 ctl_ioctl+0x2e1/0x570 [dm_mod]
 dm_ctl_ioctl+0x5/0x10 [dm_mod]
 __x64_sys_ioctl+0x85/0xa0
 do_syscall_64+0x3c/0x110
 entry_SYSCALL_64_after_hwframe+0x46/0x4e
 </TASK>

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: c467e97f079f ("md/raid6: use valid sector values to determine if an I/O should wait on the reshape")
Cc: stable@vger.kernel.org	# v6.1+

---
 drivers/md/raid5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/md/raid5.c
===================================================================
--- linux-2.6.orig/drivers/md/raid5.c
+++ linux-2.6/drivers/md/raid5.c
@@ -5851,7 +5851,7 @@ static bool stripe_ahead_of_reshape(stru
 			continue;
 
 		min_sector = min(min_sector, sh->dev[dd_idx].sector);
-		max_sector = max(max_sector, sh->dev[dd_idx].sector);
+		max_sector = min(max_sector, sh->dev[dd_idx].sector);
 	}
 
 	spin_lock_irq(&conf->device_lock);


  parent reply	other threads:[~2024-01-17 18:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 18:16 [PATCH 0/7] MD fixes for the LVM2 testsuite Mikulas Patocka
2024-01-17 18:17 ` [PATCH 1/7] md: Revert fa2bbff7b0b4 ("md: synchronize flush io with array reconfiguration") Mikulas Patocka
2024-01-18  1:27   ` Yu Kuai
2024-01-17 18:18 ` [PATCH 2/7] md: fix a race condition when stopping the sync thread Mikulas Patocka
2024-01-18  1:32   ` Yu Kuai
2024-01-18 13:07     ` Mikulas Patocka
2024-01-18 13:20       ` Yu Kuai
2024-01-18 13:28         ` Mikulas Patocka
2024-01-17 18:19 ` [PATCH 3/7] md: test for MD_RECOVERY_DONE in stop_sync_thread Mikulas Patocka
2024-01-18  0:19   ` Song Liu
2024-01-18 13:23     ` Mikulas Patocka
2024-01-18 21:10       ` Song Liu
2024-01-22 16:34         ` Mikulas Patocka
2024-01-23  2:31           ` Benjamin Marzinski
2024-01-26  9:17             ` Yu Kuai
2024-01-26  9:37               ` Yu Kuai
2024-01-26 10:29                 ` Zdenek Kabelac
2024-01-27  1:13                   ` Yu Kuai
2024-01-27  1:19                     ` Yu Kuai
2024-01-18  1:35   ` Yu Kuai
2024-01-17 18:20 ` [PATCH 4/7] md: call md_reap_sync_thread from __md_stop_writes Mikulas Patocka
2024-01-18  1:38   ` Yu Kuai
2024-01-17 18:21 ` [PATCH 5/7] md: fix deadlock in shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh Mikulas Patocka
2024-01-18  1:12   ` Song Liu
2024-01-18  1:51   ` Yu Kuai
2024-01-17 18:22 ` Mikulas Patocka [this message]
2024-01-17 23:56   ` [PATCH 6/7] md: partially revert "md/raid6: use valid sector values to determine if an I/O should wait on the reshape" Song Liu
2024-01-17 18:22 ` [PATCH 7/7] md: fix a suspicious RCU usage warning Mikulas Patocka
2024-01-17 23:59   ` Song Liu
2024-01-18  1:56   ` Yu Kuai
2024-01-25 17:31     ` Song Liu
2024-01-17 19:27 ` [PATCH 0/7] MD fixes for the LVM2 testsuite Song Liu
2024-01-18  2:03   ` Yu Kuai
2024-01-27  7:57 ` Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b725da99-d649-6f1d-af82-c3e482f7f6e@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=djeffery@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=heinzm@redhat.com \
    --cc=linan122@huawei.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=msnitzer@redhat.com \
    --cc=song@kernel.org \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).