Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4055462pxb; Mon, 8 Feb 2021 06:58:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcqVvIyHzVWJyCGS7sj77tcYJ959KVNSJeTdh/nZD4AzyQpayGyYE1L100V5hniQ0feV3E X-Received: by 2002:a17:906:6b02:: with SMTP id q2mr17669161ejr.122.1612796300731; Mon, 08 Feb 2021 06:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612796300; cv=none; d=google.com; s=arc-20160816; b=w+qHpGp5pa3wz+YBJRCyEK2dvbnkzEJEGJDmPF63u2fPcfCBcuCuUFogJOWh1Y6V5+ iDv4s5M7CnCEyAXOIWZLOA5nPSHD9OTU/Xo3PDtRAWwcQ/hWRiSseuYNNHqJ96AnK9Ak nhY9vLIELPh9P8uO6UMypQk/MFBnvVa2/01LZLX2HCZ7TPKoaDlwgca7Po+Zw2RbCdoC wTF4BRltyPzEdwBAOZ+9DO4EuFSubkX6KfuSRrMnFmTnTwu4o1d43tSUa6EmWCLh7j3w guRSv6h9fzISbO/dOoVyYaGXpmTAZeH3AUsusWY7FuUnD407UQYjhGrAMDG1CMo4fD8n DwzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=AYRGoYePQAzJ7LEhFJURePb+3/N+X+kqoSUl81c+Xxg=; b=a4uelMWDHZcfkLO5kf7xYxvqAYHsj4nNSgWvs0+QEuKk2jLq373oO7AkSl8JFgmkbl yWsC4GQ3LF8X5kLD+DDI4zkR6ZHSLvo4fo3PTbaI6m/UnR03LK+dJRck0PzljVz7z4e3 tB97cEnIjochygoEy/O3nIikECQK0956An/4oXa70SmuWv4efvEtGIyFSpw8xZWEuqcT rMPsYycse1g2e/zNINb753dSdnR9+8Ld3O3YFW562ncZ3SJSWrPAQZI4CI4CvX33udn8 tgc+zg6RVItzYkrwRJob+AotlCKBazM4G6ciiGxVKImUaB6AcE7btj1Zs9JKmByf1fJO HTBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=GHHxqHge; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si3045761edj.128.2021.02.08.06.57.57; Mon, 08 Feb 2021 06:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=GHHxqHge; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233193AbhBHO5A (ORCPT + 99 others); Mon, 8 Feb 2021 09:57:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233209AbhBHOzV (ORCPT ); Mon, 8 Feb 2021 09:55:21 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B6EFC06178B for ; Mon, 8 Feb 2021 06:54:41 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id t29so9842236pfg.11 for ; Mon, 08 Feb 2021 06:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=AYRGoYePQAzJ7LEhFJURePb+3/N+X+kqoSUl81c+Xxg=; b=GHHxqHgedWlJYgkjkbcDnLpb3OWbBGZgJYIvQehnw8oIk70LBueh4uMiVEo1sLLtEU fegcPAvpvCFDiDd/0BLKsUE3o2GknmUFAduY92QftR4YSsvF7OEsS6do7RnGV4VecXJf hw9LxEBr/FyL+gUiaIJQB/UX2Qv8rfyiOIeSAFksmiaHqJ3+H6Gk3MWt7thkNhrGRr9K OYJS2RbGi+C16zSG9BVQfaXxhmRwytMichhbsXhdA58cu6335aD+Btfu9XsMsoIoPa7d 1FIDBGMbRTkxEfYuzlUkdwdDwmS3AvBb8+Q7Ss3Hy2h8JAYsou0Opdyjj215AKCij9qR xEsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AYRGoYePQAzJ7LEhFJURePb+3/N+X+kqoSUl81c+Xxg=; b=TvLtq2iOO5H+51PFKEvXI0A7LrtxvsjXJAjYsJC+u4mts3JQKSQmAwSSUJQkijJTVW LwzliiEZX6y9WE9MhNxZmdIS0uxCdVYn4dSEqF6Xn9n17eOPTkdYC2hoARz+SR1ksi3S vCJtrV3EawOz9JZAY1lSAAQ1RIVsf+3utoYjHffDSbYjSrfsA7GX/ZaFLvZgVchrL3Cl RObR1/GJYZjnHIKZqOWorvoZ2cUIx1JygD41VAkrOr2N7/hqoH8bG38KzMnYpKiD+rsO QbvhMG2HlX/jkO+rCFBV2m5lUL0YVHr77gvVohKPVG0iq49w/u8pqJl43CvnXPWlWCB2 KXcw== X-Gm-Message-State: AOAM532a1Wv4Wf6vA2WFB4NCCRGiPzJ486ltTm0nU7LYZND4PaaYofdj EUz9kRizmMZ1ak2SLqp6C30mvQ== X-Received: by 2002:a65:5883:: with SMTP id d3mr18264467pgu.301.1612796078639; Mon, 08 Feb 2021 06:54:38 -0800 (PST) Received: from [0.0.0.0] ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id m5sm19218026pgj.11.2021.02.08.06.54.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 06:54:37 -0800 (PST) Subject: Re: md_raid: mdX_raid6 looping after sync_action "check" to "idle" transition To: Donald Buczek , Song Liu , linux-raid@vger.kernel.org, Linux Kernel Mailing List , it+raid@molgen.mpg.de References: <7c5438c7-2324-cc50-db4d-512587cb0ec9@molgen.mpg.de> <37c158cb-f527-34f5-2482-cae138bc8b07@molgen.mpg.de> <55e30408-ac63-965f-769f-18be5fd5885c@molgen.mpg.de> <30576384-682c-c021-ff16-bebed8251365@molgen.mpg.de> <6c7008df-942e-13b1-2e70-a058e96ab0e9@cloud.ionos.com> <12f09162-c92f-8fbb-8382-cba6188bfb29@molgen.mpg.de> <6757d55d-ada8-9b7e-b7fd-2071fe905466@cloud.ionos.com> <93d8d623-8aec-ad91-490c-a414c4926fb2@molgen.mpg.de> <0bb7c8d8-6b96-ce70-c5ee-ba414de10561@cloud.ionos.com> From: Guoqing Jiang Message-ID: <1cdfceb6-f39b-70e1-3018-ea14dbe257d9@cloud.ionos.com> Date: Mon, 8 Feb 2021 15:53:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/8/21 12:38, Donald Buczek wrote: >> 5. maybe don't hold reconfig_mutex when try to unregister sync_thread, >> like this. >> >>          /* resync has finished, collect result */ >>          mddev_unlock(mddev); >>          md_unregister_thread(&mddev->sync_thread); >>          mddev_lock(mddev); > > As above: While we wait for the sync thread to terminate, wouldn't it be > a problem, if another user space operation takes the mutex? I don't think other places can be blocked while hold mutex, otherwise these places can cause potential deadlock. Please try above two lines change. And perhaps others have better idea. Thanks, Guoqing