Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1522110ybh; Mon, 13 Jul 2020 23:18:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOjUDBtqeZsSKhYtOC3Bo0cES2b5MiiPkBYslIMF3UdC4nDfYEfoxyT9jXmStzdfYxMrIi X-Received: by 2002:a50:9e02:: with SMTP id z2mr2816261ede.87.1594707528245; Mon, 13 Jul 2020 23:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594707528; cv=none; d=google.com; s=arc-20160816; b=YmrEYD6Ozt0L0fQpcyswrD4Kpwj6f3CAffIKfnUOchbq+SHlqMu4xfGOUQtai/WgQL //39P4V/GznI4fUflzptv/TotF0zTsSD+YMxh61yBKb5SQuIYSAYH9lt8Df7UlXHmnYz k6AX4cXjfdPg3FVucHgkgKlvHblxpRYRzeZmkRssPhFN1Y5fnljx4k/iuaE8O2KdrNZU ZjEHVCb48SAsDWAlDUU2TtLSpxBIbASFysz0s1YTAc539I6wXGBOZlgG+AtsvxmRYg+W dg5v1l2G5v1qg7BiCZonimvJBlQdUMEsEtrjbZxHOblMnxkdx7nRwbjrl6r+PoFXDjqP 5V0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=V0ES9FfPPFi3MeZLN7Yk694DqLUZwWJOE66C404HMGY=; b=PDGn5U7J92OGwTT6KB9lnTxR6uztObfcwXFOlDfqhOePb+H3E79LHZ5QiOM97fzhXW 5WBjQIZ97cpL9s8ZbJfSKJboLrJTKdwOHL9EjSxC3Vc1hx9JHrwc3DAmfheP0oAsnvvA 6tNaR0zhEaA9jKOoqv0681+XANLPRJp0jZJ06jQO8kGBdUMbKWv0pjO3i6mjIn3bvvYT 4l7quGK/ntZ1W3hi7v0lgeXY6hecTAZCDZlBteLo5Y3Cf+JO+/dUlSFcTILTbw8KiB4z H/qBGFW27Is3qht56rK+OjL+mY1M/GtuKL9hh03eeduCY1A7U4j8LEzajlhEXaiPmE3k fGOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WfVe7njj; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb18si10488811ejb.534.2020.07.13.23.18.25; Mon, 13 Jul 2020 23:18:48 -0700 (PDT) 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=@kernel.org header.s=default header.b=WfVe7njj; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbgGNGRm (ORCPT + 99 others); Tue, 14 Jul 2020 02:17:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:57612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbgGNGRm (ORCPT ); Tue, 14 Jul 2020 02:17:42 -0400 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9D298221E8; Tue, 14 Jul 2020 06:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594707462; bh=tVvKmkDwjOWKtYnQwCdwRPJ1H7o5sE4gOhRBkFToH/s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WfVe7njjv/NJVNeTtgJF6Chu9iGzDgGhqNUuWquFDX04G+wo3URpGw9idKUe2iOFk dAVoRPjub6IUhayrU7OKVvdPGnAbJtiSnWnDZu8txQ/L7cYg5IczBpigZ/fD0yQ+Lo Y9G+iEVpcHlUr0hp7OgqhLgiFfM0vL/hx/Kem6Ok= Received: by mail-lj1-f173.google.com with SMTP id s9so21048428ljm.11; Mon, 13 Jul 2020 23:17:41 -0700 (PDT) X-Gm-Message-State: AOAM5330kN63P33JNNGohXr4FOIAe4FEvSgdCUsqH+9aXSKbx7K2fpBS VPSNhLr45C3L9Z9nNQm2yWHTyN7Da08Nj7EQqs0= X-Received: by 2002:a2e:9996:: with SMTP id w22mr1661469lji.446.1594707460008; Mon, 13 Jul 2020 23:17:40 -0700 (PDT) MIME-Version: 1.0 References: <20200709233545.67954-1-junxiao.bi@oracle.com> In-Reply-To: <20200709233545.67954-1-junxiao.bi@oracle.com> From: Song Liu Date: Mon, 13 Jul 2020 23:17:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] md: fix deadlock causing by sysfs_notify To: Junxiao Bi Cc: linux-raid , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: > > The following deadlock was captured. The first process is holding 'kernfs_mutex' > and hung by io. The io was staging in 'r1conf.pending_bio_list' of raid1 device, > this pending bio list would be flushed by second process 'md127_raid1', but > it was hung by 'kernfs_mutex'. Using sysfs_notify_dirent_safe() to replace > sysfs_notify() can fix it. There were other sysfs_notify() invoked from io > path, removed all of them. > [...] > > Cc: stable@vger.kernel.org > Signed-off-by: Junxiao Bi Thanks for the patch. It looks good in general. One question though, do we need the same change the following line in md.c:level_store()? sysfs_notify(&mddev->kobj, NULL, "level"); Thanks, Song [...]