Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3420396pxf; Mon, 29 Mar 2021 01:32:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHl1X3iVcC+80wBD9DKvesX0GifDL16x+0/OeeUeXqRmmdz79X6+Q3F5eJSa7Huxa0Ufg/ X-Received: by 2002:a17:906:f1c8:: with SMTP id gx8mr28169853ejb.385.1617006750677; Mon, 29 Mar 2021 01:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006750; cv=none; d=google.com; s=arc-20160816; b=mFbdj711SRoQw68h+NjyKOq+jLDXbLCb6PiCsREnj8QUWPDHGMTjU3IX8knANU3+t+ jkKJkhHwEVN/qdc/T3d69Q7sgML6ju5GWiBWHdFD2iD/6F52PFUXcxpw3e8Mt1Y6EFJ6 o1CIUX5E21tQY2Af6v29knAKpvP4anU6zZILAPMqSCmW8BXFyMLYKMgFR1isOXXhRumb J4mfd0V9F3lrondanmJI/n6IHaVKrt0+odTuj68sovnoC3L1FPEBZwGXLcJBJOZ/jQHS tbQkoLpDPiTIW2qQ865Y6wbmknBSXwayR5K2TUNKx19DAATf53wmAxuCYEGAvwOMKewd pUgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YKrEAWxuAnBsLsBe8CjEjhKq9vbVpLNIsUoQDnCVURs=; b=LYQbrPsP0DX99ZfzP1ucSL77I8zB85sOIg+iqv25eagMg3t/qkXbxyGNwxhH2AeCz6 TjSkHzmLe3eFFMEVOV1nVHWYtESZsc9O0DZtHsKKkBKcRbC+jDfIHBaBkX/3Y0XpQxmw yApzQsf6ySfju/vjWC7KeKjMyXEq7Y6XLlHExfoNFWpquYDQ96O+2tCKdM3Slebkcw5C NUN1iUUBvFtvoopqO92CIsck6Fgv81IzJkoqoQazmEmw9T0H1sGDNNLVM2hs8+bar4DR ErkgP7RW60KLxLF6FO1nM0DvtB4c2SBRjL5Pbm9qXePvmngebUm4rIKxS3bSLymoo8HI CSrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=krfCfn8Z; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si12133041eds.169.2021.03.29.01.32.09; Mon, 29 Mar 2021 01:32:30 -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=@linuxfoundation.org header.s=korg header.b=krfCfn8Z; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234772AbhC2I3A (ORCPT + 99 others); Mon, 29 Mar 2021 04:29:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:34262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbhC2ISn (ORCPT ); Mon, 29 Mar 2021 04:18:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6ABC61932; Mon, 29 Mar 2021 08:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005923; bh=BST6BERa959iMhTwUiAolYvYPSiDPLKLUM2upjFG3ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krfCfn8Zu3v7U25SeEXfQGxLsSDTd3P/ZhIPb9hdwlvbpmlylxLEPobiljzNOOtYt 7toYU7YgxTRTPfw1+ecdOC96o/BUkzpwj7ITrIgsckfrevSYEfHmqp22oYhZ18npDf boIPycWpCZRkKvb8x4PvBS0L6nTb/rhf4AUuI+kc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wagner , Christoph Hellwig , Martin Wilck , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 053/221] block: Suppress uevent for hidden device when removed Date: Mon, 29 Mar 2021 09:56:24 +0200 Message-Id: <20210329075630.953928489@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Wagner [ Upstream commit 9ec491447b90ad6a4056a9656b13f0b3a1e83043 ] register_disk() suppress uevents for devices with the GENHD_FL_HIDDEN but enables uevents at the end again in order to announce disk after possible partitions are created. When the device is removed the uevents are still on and user land sees 'remove' messages for devices which were never 'add'ed to the system. KERNEL[95481.571887] remove /devices/virtual/nvme-fabrics/ctl/nvme5/nvme0c5n1 (block) Let's suppress the uevents for GENHD_FL_HIDDEN by not enabling the uevents at all. Signed-off-by: Daniel Wagner Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck Link: https://lore.kernel.org/r/20210311151917.136091-1-dwagner@suse.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/genhd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index ec6264e2ed67..796baf761202 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -732,10 +732,8 @@ static void register_disk(struct device *parent, struct gendisk *disk, disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); - if (disk->flags & GENHD_FL_HIDDEN) { - dev_set_uevent_suppress(ddev, 0); + if (disk->flags & GENHD_FL_HIDDEN) return; - } disk_scan_partitions(disk); -- 2.30.1