]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm raid: use proper md_ro_state enumerators
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 18 Sep 2025 13:48:40 +0000 (15:48 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Tue, 23 Sep 2025 12:51:04 +0000 (14:51 +0200)
commit55dcfdf8af9c38cce6f5b2058d3b58dde25e5020
tree3f77d5be93117db2720a101104e73076f8b52198
parent1cd83fb79083a2431f513956afca92b690ef11ad
dm raid: use proper md_ro_state enumerators

The dm-raid code was using hardcoded integer values to represent the
read-only/read-write state of RAID arrays instead of the proper
enumeration constants defined in the md_ro_state enumerator type.

Changes:

- Replace hardcoded integers with the appropriate md_ro_state enumerator
  values

- Add the missing MD_RDONLY setting in the post_suspend function
  (no failures have been attributed to this inconsistency, the fix
  ensures correct state transitions for completeness)

This improves code clarity and maintainability by using the defined
enumeration constants rather than magic numbers, ensuring the code
properly conforms to the established API interface.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-raid.c