← Commit list

782ee2aa0

Kevin Wallace
Kevin Wallace
2015-02-07
SUCCESS Duration: 148s

Subject

libbb/loop: don't try to re-use existing loop device

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/loop.c+1 -10
@@ -154,16 +154,7 @@ int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse
else
ioctl(dfd, LOOP_CLR_FD, 0);
}
-
- /* If this block device already set up right, re-use it.
- * (Yes this is racy, but associating two loop devices with the same
- * file isn't pretty either. In general, mounting the same file twice
- * without using losetup manually is problematic.)
- */
- } else
- if (strcmp(file, (char *)loopinfo.lo_file_name) != 0
- || offset != loopinfo.lo_offset
- ) {
+ } else {
rc = -1;
}
close(dfd);