The man page about loop devices (loop 4) has incorrect information. Under the LOOP_SET_STATUS and LOOP_SET_STATUS64 ioctl commands the following line seems to indicate this field is readonly: int lo_flags; /* ioctl r/o */ when in reality the user can set both the LO_FLAGS_AUTOCLEAR and LO_FLAGS_PARTSCAN flags.
Thanks. I applied the commit below. Closing this bug now. commit e7f884d017238ce47c3325db01712564c2a48add (HEAD -> master) Author: Michael Kerrisk <mtk.manpages@gmail.com> Date: Wed May 6 11:33:21 2020 +0200 loop.4: 'lo_flags' is nowadays "r/w" Since kernel commit 96c5865559cee0f9cbc5173f3c949f6ce3525581, the 'lo_flags' field is modifiable via the LOOP_SET_STATUS and LOOP_SET_STATUS64 ioctl() operations. See https://bugzilla.kernel.org/show_bug.cgi?id=203417 Reported-by: Vlad <cvazir@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> diff --git a/man4/loop.4 b/man4/loop.4 index 74858da7a..d95c38e77 100644 --- a/man4/loop.4 +++ b/man4/loop.4 @@ -89,7 +89,8 @@ struct loop_info { int lo_offset; int lo_encrypt_type; int lo_encrypt_key_size; /* ioctl w/o */ - int lo_flags; /* ioctl r/o */ + int lo_flags; /* ioctl r/w (r/o before + Linux 2.6.25) */ char lo_name[LO_NAME_SIZE]; unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ @@ -197,7 +198,8 @@ struct loop_info64 { uint32_t lo_number; /* ioctl r/o */ uint32_t lo_encrypt_type; uint32_t lo_encrypt_key_size; /* ioctl w/o */ - uint32_t lo_flags; /* ioctl r/o */ + uint32_t lo_flags; i /* ioctl r/w (r/o before + Linux 2.6.25) */ uint8_t lo_file_name[LO_NAME_SIZE]; uint8_t lo_crypt_name[LO_NAME_SIZE]; uint8_t lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */