Jim MacBaine wrote: > Maybe you can have a quick look on it. Thanks, Jim. I merged your patch with some changes. > Is it really so simple or am I missing some important point here? You missed 32 bit userland on 64 bit kernel "weirdo" part. On newer kernels when 32 bit program makes ioctl call to 64 bit driver, the driver must handle those ioctls using ->compat_ioctl() hook. On older kernels, register_ioctl32_conversion() can be used to tag 32 bit ioctls so that they get passed to 64 bit driver. I added code for both methods, so that one of them can be compiled into the driver. It depends on kernel version which method gets used. I also changed the ioctl number to: #define LOOP_RECOMPUTE_DEV_SIZE 0x4C52 Why? Because the code 0x4C07 you used is likely to end up having a conflict with some other loop ioctl function. Few years ago, Red Had kernels used 0x4C04 loop ioctl, and later, mainline kernels defined that same code for completely different purpose. Mount and losetup programs still have special code that attempts to detect if they are running on old RH kernel, and work around the problem if necessary. Works, but it isn't pretty. > Would it be worth the effort to include a this functionality into losetup? Done. It is now "losetup -R /dev/loop0", unless someone vetoes that. -- Jari Ruusu 1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9 DB 1D EB E3 24 0E A9 DD - Linux-crypto: cryptography in and on the Linux system Archive: http://mail.nl.linux.org/linux-crypto/