summaryrefslogtreecommitdiff
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-07-19 12:18:23 +0300
committerJens Axboe <axboe@kernel.dk>2022-08-03 02:22:44 +0300
commit12a6caf273240ae42842de8cc05feaa86e582d61 (patch)
tree46a857e07a65f026f4f30d4d69475891349a0e5c /drivers/md/md.h
parent16648bac862fd9c6490a465533345fbeaa6466e0 (diff)
downloadlinux-12a6caf273240ae42842de8cc05feaa86e582d61.tar.xz
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.h2
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 {