diff options
author | Christoph Hellwig <hch@lst.de> | 2022-07-19 11:18:23 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-08-03 01:22:44 +0200 |
commit | 12a6caf273240ae42842de8cc05feaa86e582d61 (patch) | |
tree | 46a857e07a65f026f4f30d4d69475891349a0e5c /drivers/md/md.h | |
parent | md: stop using for_each_mddev in md_exit (diff) | |
download | linux-12a6caf273240ae42842de8cc05feaa86e582d61.tar.xz linux-12a6caf273240ae42842de8cc05feaa86e582d61.zip |
md: only delete entries from all_mddevs when the disk is freed
This ensures device names don't get prematurely reused. Instead add a
deleted flag to skip already deleted devices in mddev_get and other
places that only want to see live mddevs.
Reported-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 861088b3d236..f6ab73c90b7d 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -254,6 +254,7 @@ struct md_cluster_info; * @MD_NOT_READY: do_md_run() is active, so 'array_state', ust not report that * array is ready yet. * @MD_BROKEN: This is used to stop writes and mark array as failed. + * @MD_DELETED: This device is being deleted * * change UNSUPPORTED_MDDEV_FLAGS for each array type if new flag is added */ @@ -270,6 +271,7 @@ enum mddev_flags { MD_UPDATING_SB, MD_NOT_READY, MD_BROKEN, + MD_DELETED, }; enum mddev_sb_flags { |