On Fri 21 Mar 2014 17:43:29 Stanislav Kholmanskikh wrote: > On 03/21/2014 02:44 PM, Stanislav Kholmanskikh wrote: > > I think that according to the patch the described behaviour is > > absolutely expected. Therefore It would be better to leave "ls -lR" in > > the test or insert a 'sleep' instead. In this case we would use no more > > than 2 loop devices per iteration. > > I suppose it would be a better solution (and without any waitings): > > loop_dev=$(losetup --show -f isofs.iso) > # do mount and other stuff > # do umount > while /bin/true; do > out=$(losetup -d "$loop_dev" 2>&1) > > if echo "$out" | grep -q -i "No such device"; then > break > fi > done > > This way we doesn't depend on asynchrony in the loop-driver code.
that might work. certainly the current code, if it's trying to make the script "sleep" in hopes the device is no longer in use by udev/whatever, is also broken. make sure to use LC_ALL=C though when running losetup so the localization doesn't screw up the grep. -mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
