diff options
author | Jeremy Bongio <bongiojp@gmail.com> | 2022-07-21 15:44:22 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2022-08-02 23:56:26 -0400 |
commit | d95efb14c0b81b684deb32ba10cdb78b4178ae5b (patch) | |
tree | dc535f856a9dad220ccfa28f75d8f354e8c724bc /fs/ext4/ext4.h | |
parent | 69cb8e9d8cd97cdf5e293b26d70a9dee3e35e6bd (diff) | |
download | lwn-d95efb14c0b81b684deb32ba10cdb78b4178ae5b.tar.gz lwn-d95efb14c0b81b684deb32ba10cdb78b4178ae5b.zip |
ext4: add ioctls to get/set the ext4 superblock uuid
This fixes a race between changing the ext4 superblock uuid and operations
like mounting, resizing, changing features, etc.
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jeremy Bongio <bongiojp@gmail.com>
Link: https://lore.kernel.org/r/20220721224422.438351-1-bongiojp@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 310e976ef1fd..349c9a170219 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -724,6 +724,8 @@ enum { #define EXT4_IOC_GETSTATE _IOW('f', 41, __u32) #define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap) #define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32) +#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid) +#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid) #define EXT4_IOC_SHUTDOWN _IOR ('X', 125, __u32) @@ -753,6 +755,15 @@ enum { EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | \ EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN) +/* + * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID + */ +struct fsuuid { + __u32 fsu_len; + __u32 fsu_flags; + __u8 fsu_uuid[]; +}; + #if defined(__KERNEL__) && defined(CONFIG_COMPAT) /* * ioctl commands in 32 bit emulation |