On 06/09/2015 03:50 PM, Cyril Hrubis wrote:
<cut>
>
>
> I think that we should do:
>
> detach_device(..)
> {
>       while EBUSY:
>               ioctl(fd, LOOP_CLR_FD);
>
>       while not error:
>               ioclt(LOOP_GET_STATUS);
>               usleep();
> }
>
> Because if we ignore the return value from LOOP_CLR_FD we will break on
> older kernels where we may get EBUSSY instead of lazy detach. And the
> LOOP_GET_STATUS* ioctls should return error when device is not attached,
> at least if I'm reading kernel code right.
>
>

I've just sent a patch for detach_device. It turned out that 
LOOP_GET_STATUS is redundant here, we can control this situation via 
LOOP_CLR_FD + ENXIO.

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to