Bug 14316

Summary: get_free_loop needs waiting
Product: Busybox Reporter: wjh <aswjh>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: major CC: busybox-cvs
Priority: P5    
Version: 1.33.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description wjh 2021-11-03 04:12:17 UTC
libbb/loop.c: set_loop

Sometimes loop device is not ready arter get_free_loop, 
raise "can't setup loop device: No such file or directory".


It will be ok if usleep before "goto open_lfd":

try = xasprintf(LOOP_FORMAT, i); 
for (lc=0; lc<100; lc++) {
  if (stat(try, &buf2)==0) break; 
  usleep(20);
}

goto open_lfd;
Comment 1 wjh 2021-11-03 04:23:16 UTC
Linux box 5.3.11-tinycore64 #1 SMP Wed Nov 20 08:16:37 CST 2019 x86_64 GNU/Linux