]> git.baikalelectronics.ru Git - kernel.git/commit
dm raid: fix oops on upgrading to extended superblock format
authorHeinz Mauelshagen <heinzm@redhat.com>
Fri, 23 Jun 2017 15:27:01 +0000 (17:27 +0200)
committerMike Snitzer <snitzer@redhat.com>
Fri, 23 Jun 2017 16:16:15 +0000 (12:16 -0400)
commit2ae01fb1424b1145a6794fa08f62e2e24809f179
treed67e5acc7bbc9657e1814e4d71678d22fe853eda
parent58bc7cf8498498f6ee84d72815b7b6c31e46a564
dm raid: fix oops on upgrading to extended superblock format

When a RAID set was created on dm-raid version < 1.9.0 (old RAID
superblock format), all of the new 1.9.0 members of the superblock are
uninitialized (zero) -- including the device sectors member needed to
support shrinking.

All the other accesses to superblock fields new in 1.9.0 were reviewed
and verified to be properly guarded against invalid use.  The 'sectors'
member was the only one used when the superblock version is < 1.9.

Don't access the superblock's >= 1.9.0 'sectors' member unconditionally.
Also add respective comments.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c