This is a note to let you know that I've just added the patch titled md: export helper md_is_rdwr() to the 6.7-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-export-helper-md_is_rdwr.patch and it can be found in the queue-6.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4c42ca92361092ff81031dce190a574c76bbe5b3 Author: Yu Kuai <yukuai3@xxxxxxxxxx> Date: Tue Mar 5 15:23:00 2024 +0800 md: export helper md_is_rdwr() [ Upstream commit 314e9af065513ff86ec9e32eaa96b9bd275cf51d ] There are no functional changes for now, prepare to fix a deadlock for dm-raid456. Cc: stable@xxxxxxxxxxxxxxx # v6.7+ Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx> Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> Acked-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Song Liu <song@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240305072306.2562024-4-yukuai1@xxxxxxxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/md/md.c b/drivers/md/md.c index 740541f6cad98..bae513018849a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -99,18 +99,6 @@ static void mddev_detach(struct mddev *mddev); static void export_rdev(struct md_rdev *rdev, struct mddev *mddev); static void md_wakeup_thread_directly(struct md_thread __rcu *thread); -enum md_ro_state { - MD_RDWR, - MD_RDONLY, - MD_AUTO_READ, - MD_MAX_STATE -}; - -static bool md_is_rdwr(struct mddev *mddev) -{ - return (mddev->ro == MD_RDWR); -} - /* * Default number of read corrections we'll attempt on an rdev * before ejecting it from the array. We divide the read error diff --git a/drivers/md/md.h b/drivers/md/md.h index 0d06d640aa06d..db0cb00e4c9ac 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -559,6 +559,18 @@ enum recovery_flags { MD_RESYNCING_REMOTE, /* remote node is running resync thread */ }; +enum md_ro_state { + MD_RDWR, + MD_RDONLY, + MD_AUTO_READ, + MD_MAX_STATE +}; + +static inline bool md_is_rdwr(struct mddev *mddev) +{ + return (mddev->ro == MD_RDWR); +} + static inline int __must_check mddev_lock(struct mddev *mddev) { return mutex_lock_interruptible(&mddev->reconfig_mutex);