> why isn't it possible to use
>
> # losetup -o 2048 /dev/loop0 /dev/scd0
> ioctl: LOOP_SET_STATUS: Invalid argument
>
> without `-o 2048' the loopback works fine (but is useless because I need to skip
> the first sector;). strace shows:
>
> # strace losetup -o 2048 /dev/loop0 /dev/scd0
> ...
> open("/dev/scd0", O_RDWR) = -1 EROFS (Read-only file system)
> open("/dev/scd0", O_RDONLY) = 3
> open("/dev/loop0", O_RDONLY) = 4
> ioctl(4, LOOP_SET_FD, 0x3) = 0
> ioctl(4, LOOP_SET_STATUS, 0xbffff500) = -1 EINVAL (Invalid argument)
> ioctl(4, LOOP_CLR_FD, 0) = 0
> write(2, "ioctl: LOOP_SET_STATUS: Invalid "..., 41ioctl: LOOP_SET_STATUS: Invalid argument) = 41
My guess is that you have a miscompiled losetup utility. Most losetups
compiled with glibc 2.0 are broken, because glibc changed the size of dev_t
without bothering to supply a linux/loop.h replacement (struct loop_info
contains dev_t). Compiled with a 32bit dev_t you really need set
lo_encrypt_type, and the kernel obviously doesn't know how to deal with
lo_encrypt_type 2048.
Unfortunately there is no easy way to fix losetup without introducing
glibc version dependencies, because glibc offers no public function to convert
its dev_t (from its stat wrapper) into a kernel dev_t.
I filled a glibc PR for this some time ago, but it was closed for reasons
I cannot follow (because the glibc bug is still here).
-Andi
-- This is like TV. I don't like TV.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/