[LTP] [PATCH] lib/tst_device.c: Add exception handling of function tst_find_free_loopdev

zhaogongyi zhaogongyi@huawei.com
Mon Mar 15 13:06:45 CET 2021


Hi Cyril,

I mean that /dev/loopX maybe removed by mistake after we get a free loop dev /dev/loopX. And in this case, we could try to create it or report error info immediately?

Actually,it seems there has no Sufficient reason to do it.

Thanks so much!

Best Regards,
Gongyi

> 
> Hi!
> > > In addition, when "loopdevno = ioctl(fd, LOOP_CTL_GET_FREE)" get
> > > free loop device i, and the loop device file /dev/loop%i has been
> removed??
> > > set_dev_path will return 1 and set " /dev/block/loop%i "
> > > in path. It might happened in many Embedded Systems because the
> test
> > > process's id is root always. So we could also Add exception handling?
> >
> > Or maybe we can try to create it when node doesn't exist?
> > 	mknod("/dev/loop%i", S_IFBLK|0644, makedev(7, i))
> 
> I do not really get what happens on your system. It looks like dev fs is not
> properly populated, which would be bug in your system rather than in the
> test library.
> 
> What is the state of /dev/loop* and /dev/block/loop* before you attempt
> to run the test?
> 
> --
> Cyril Hrubis
> chrubis@suse.cz


More information about the ltp mailing list