History

md: reintroduce md-linear

THe md-linear is removed by commit 849d18e27be9 ("md: Remove deprecated CONFIG_MD_LINEAR") because it has been marked as deprecated for a long time. However, md-linear is used widely for underlying disks with different size, sadly we didn't know this until now, and it's true useful to create partitions and assemble multiple raid and then append one to the other. People have to use dm-linear in this case now, however, they will prefer to minimize the number of involved modules.

Yu Kuai committed 1 year ago

Commit 127186c1 parent e494e457 files · +379 −4Browse files

Showing the changes to include/uapi (2 of 7 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/raid/md_p.h +1 −1
  2. include/uapi/linux/raid/md_u.h +2 −0
include/uapi/linux/raid/md_p.h+1−1
@@ -233,7 +233,7 @@ struct mdp_superblock_1 { · 232 unmodified lines
233233 char set_name[32]; /* set and interpreted by user-space */
234234
235235 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
236− __le32 level; /* 0,1,4,5 */
236+ __le32 level; /* 0,1,4,5, -1 (linear) */
237237 __le32 layout; /* only for raid5 and raid10 currently */
238238 __le64 size; /* used size of component devices, in 512byte sectors */
239239
include/uapi/linux/raid/md_u.h+2−0
@@ -103,6 +103,8 @@ typedef struct mdu_array_info_s { · 102 unmodified lines
103103
104104 } mdu_array_info_t;
105105
106+#define LEVEL_LINEAR (-1)
107+
106108 /* we need a value for 'no level specified' and 0
107109 * means 'raid0', so we need something else. This is
108110 * for internal use only