Thread (7 messages) 7 messages, 3 authors, 2021-04-05

Re: [PATCH 2/2] md: split mddev_find

From: heming.zhao@suse.com <hidden>
Date: 2021-04-04 02:32:46

On 4/4/21 12:15 AM, Christoph Hellwig wrote:
quoted hunk ↗ jump to hunk
Split mddev_find into a simple mddev_find that just finds an existing
mddev by the unit number, and a more complicated mddev_find that deals
with find or allocating a mddev.

... ...
Fixes: d3374825ce57 ("md: make devices disappear when they are no longer needed.")
Reported-by: Zhao Heming <redacted>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
  drivers/md/md.c | 24 +++++++++++++++++++-----
  1 file changed, 19 insertions(+), 5 deletions(-)

... ...
@@ -6530,11 +6546,9 @@ static void autorun_devices(int part)
  
  		md_probe(dev);
  		mddev = mddev_find(dev);
-		if (!mddev || !mddev->gendisk) {
-			if (mddev)
-				mddev_put(mddev);
+		if (!mddev)
  			break;
-		}
+
  		if (mddev_lock(mddev))
  			pr_warn("md: %s locked, cannot run\n", mdname(mddev));
  		else if (mddev->raid_disks || mddev->major_version
autorun_devices use md_probe (when create_on_open is ture) to create mddev & gendisk,
mddev_find is only need to do finding job there.

looks good to me.
Reviewed-by: Heming Zhao <redacted>

Thanks,
Heming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help