Increase number of retries
PATCH 1/2 Increase number of retries
There have been 3 bug reports so far, that claim increasing the number of retries allows clean up of loop device
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=785251
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734794
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608737
I can't be sure if this is the ideal number of retries, but for many users it seems to have solved the error
Signed-off-by Ritesh Raj Sarraf <[email protected]>
--- kpartx/lopart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kpartx/lopart.c +1 -1
@@ -288,7 +288,7 @@ set_loop (const char *device, const char *file, int offset, int *loopro)extern int del_loop (const char *device) { -int retries =3 ; +int retries =5 ;int fd;if ((fd =open (device,O_RDONLY )) <0 ) {
Signature · 1 line
2.1.4
PATCH 2/2 Display error when we fail to delete device
We are exiting when the device fails, so also print an error message
Signed-off-by Ritesh Raj Sarraf <[email protected]>
--- kpartx/kpartx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kpartx/kpartx.c +2 -3
@@ -448,9 +448,8 @@ main(int argc, char **argv){if (S_ISREG (buf.st_mode)) {if (del_loop (device)) { -if (verbose) -printf ("can't del loop : %s\n" , - device); +printf ("can't del loop : %s\n" , + device);exit (1 ); }printf ("loop deleted : %s\n" , device);
Signature · 1 line
2.1.4