From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Daniel Wagner <dwagner@suse.de>, Christoph Hellwig <hch@lst.de>,
Martin Wilck <mwilck@suse.com>, Jens Axboe <axboe@kernel.dk>,
Sasha Levin <sashal@kernel.org>,
linux-block@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 21/23] block: Suppress uevent for hidden device when removed
Date: Tue, 16 Mar 2021 20:58:47 -0400 [thread overview]
Message-ID: <20210317005850.726479-21-sashal@kernel.org> (raw)
In-Reply-To: <20210317005850.726479-1-sashal@kernel.org>
From: Daniel Wagner <dwagner@suse.de>
[ 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 <dwagner@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Link: https://lore.kernel.org/r/20210311151917.136091-1-dwagner@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/genhd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index aee2fa9de1a7..27a410d31087 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -623,10 +623,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;
- }
/* No minors to use for partitions */
if (!disk_part_scan_enabled(disk))
--
2.30.1
next prev parent reply other threads:[~2021-03-17 1:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 0:58 [PATCH AUTOSEL 4.19 01/23] net: fec: ptp: avoid register access when ipg clock is disabled Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 02/23] powerpc/4xx: Fix build errors from mfdcr() Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 03/23] atm: eni: dont release is never initialized Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 04/23] atm: lanai: dont run lanai_dev_close if not open Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 05/23] Revert "r8152: adjust the settings about MAC clock speed down for RTL8153" Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 06/23] ixgbe: Fix memleak in ixgbe_configure_clsu32 Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 07/23] net: tehuti: fix error return code in bdx_probe() Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 08/23] sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 09/23] gianfar: fix jumbo packets+napi+rx overrun crash Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 10/23] gpiolib: acpi: Add missing IRQF_ONESHOT Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 11/23] nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 12/23] NFS: Correct size calculation for create reply length Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 13/23] net: hisilicon: hns: fix error return code of hns_nic_clear_all_rx_fetch() Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 14/23] net: wan: fix error return code of uhdlc_init() Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 15/23] atm: uPD98402: fix incorrect allocation Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 16/23] atm: idt77252: fix null-ptr-dereference Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 17/23] sparc64: Fix opcode filtering in handling of no fault loads Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 18/23] u64_stats,lockdep: Fix u64_stats_init() vs lockdep Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 19/23] drm/radeon: fix AGP dependency Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 20/23] nfs: we don't support removing system.nfs4_acl Sasha Levin
2021-03-17 0:58 ` Sasha Levin [this message]
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 22/23] ia64: fix ia64_syscall_get_set_arguments() for break-based syscalls Sasha Levin
2021-03-17 0:58 ` [PATCH AUTOSEL 4.19 23/23] ia64: fix ptrace(PTRACE_SYSCALL_INFO_EXIT) sign Sasha Levin
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=20210317005850.726479-21-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mwilck@suse.com \
--cc=stable@vger.kernel.org \
/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