On Thu, Nov 18, 2021 at 11:51:21PM +0900, Tetsuo Handa wrote: > On 2021/11/18 23:15, Tetsuo Handa wrote: > > On 2021/11/18 11:36, wangyangbo wrote: > >> @@ -2170,11 +2170,11 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd, > >> { > >> switch (cmd) { > >> case LOOP_CTL_ADD: > >> - return loop_add(parm); > >> + return loop_add(MINOR(parm)); > > > > Better to return -EINVAL or something if out of minor range? > > Well, this is not specific to loop devices. > Shouldn't the minor range be checked by device_add_disk() ? Yes, that probably makes sense.