]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Check major number of block device when querying md device
authorXiao Ni <xni@redhat.com>
Wed, 30 May 2018 05:49:41 +0000 (13:49 +0800)
committerJes Sorensen <jsorensen@fb.com>
Fri, 1 Jun 2018 16:45:10 +0000 (12:45 -0400)
commit27e39ad31cbdfe516f9f390cc860a4f681750ef0
tree061d446b9e71b468f0f3074c42e2e27b3137a9ab
parent002a5978f015a77ecc48487006b1030f9dbe1394
Check major number of block device when querying md device

It give error message when query a non md device.
mdadm /dev/null
/dev/null: is an md device, but gives "Inappropriate ioctl for device" when queried

It's introduced by commit 5cb8599 and 8d0cd09
At first it checks whether a block is md device by function md_get_version.
In this function it does mainly two jobs:
1. send request by ioctl. (now it can be replace by argument ioctlerr)
2. check the block device major number which we don't do this.

We add the second judgement in this patch.

Fixes: 5cb8599 and 8d0cd09
Reported-by: Karsten Weiss <karsten.weiss@atos.net>
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Query.c