]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
Prevent create IMSM volume with size smaller than 1M or chunk
authorRoman Sobanski <roman.sobanski@intel.com>
Wed, 25 Apr 2018 09:25:06 +0000 (11:25 +0200)
committerJes Sorensen <jsorensen@fb.com>
Wed, 25 Apr 2018 13:30:05 +0000 (09:30 -0400)
commit54865c30d5b94920318950e29a4f6c1ce075cae8
tree95faab3837051af67bab3902b2a942add0902b57
parent444909385fdaccf961308c4319d7029b82bf8bb1
Prevent create IMSM volume with size smaller than 1M or chunk

Block creation of the imsm volume when given size is smaller than 1M and
print appropriate message.

Commit b53bfba6119d3f6f56eb9e10e5a59da6901af159
(imsm: use rounded size for metadata initialization) introduces issue with
rounding volume sizes smaller than 1M to 0. There is an inconsistency when
size smaller than 1M was given depends of what we give as target device:
1) When block devices was given created volume has maximum available size.
2) When container symlink was given created volume has size 0. Additionally
it causes below call trace:

[69587.891556] WARNING: CPU: 28 PID: 22485 at ../drivers/md/md.c:7582 md_seq_show+0x764/0x770 [md_mod]
[69588.066405] Call Trace:
[69588.066409]  seq_read+0x336/0x430
[69588.066411]  proc_reg_read+0x40/0x70
[69588.066412]  __vfs_read+0x26/0x140
[69588.066414]  vfs_read+0x89/0x130
[69588.066415]  SyS_read+0x42/0x90
[69588.066417]  do_syscall_64+0x74/0x140
[69588.066419]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2

Signed-off-by: Roman Sobanski <roman.sobanski@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c