From: Stanislav Brabec Date: Tue, 27 May 2014 18:38:17 +0000 (+0200) Subject: losetup: don't ignore EBUSY in losetup when the loop device is given X-Git-Tag: v2.25-rc1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ef7d6c69201190d9623885d418f9bdcf31642e;p=thirdparty%2Futil-linux.git losetup: don't ignore EBUSY in losetup when the loop device is given losetup ignores the EBUSY error. In the loop fo A_CREATE action, it skips the error handling when errno = EBUSY. It's OK for the case where no loop device is specified, but the error has to be handled when the device is given explicitly. Author: Takashi Iwai Signed-off-by: Stanislav Brabec --- diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index f6b8685a36..ecba8a56ca 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -662,7 +662,7 @@ int main(int argc, char **argv) res = loopcxt_setup_device(&lc); if (res == 0) break; /* success */ - if (errno == EBUSY) + if (errno == EBUSY && !hasdev) continue; /* errors */