diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c index dc3d12da..014527ec 100644 --- a/kmod/src/ioctl.c +++ b/kmod/src/ioctl.c @@ -546,11 +546,6 @@ static long scoutfs_ioc_stat_more(struct file *file, unsigned long arg) struct scoutfs_inode_info *si = SCOUTFS_I(inode); struct scoutfs_ioctl_stat_more stm; - if (get_user(stm.valid_bytes, (__u64 __user *)arg)) - return -EFAULT; - - stm.valid_bytes = min_t(u64, stm.valid_bytes, - sizeof(struct scoutfs_ioctl_stat_more)); stm.meta_seq = scoutfs_inode_meta_seq(inode); stm.data_seq = scoutfs_inode_data_seq(inode); stm.data_version = scoutfs_inode_data_version(inode); @@ -558,7 +553,7 @@ static long scoutfs_ioc_stat_more(struct file *file, unsigned long arg) stm.crtime_sec = si->crtime.tv_sec; stm.crtime_nsec = si->crtime.tv_nsec; - if (copy_to_user((void __user *)arg, &stm, stm.valid_bytes)) + if (copy_to_user((void __user *)arg, &stm, sizeof(stm))) return -EFAULT; return 0; @@ -879,9 +874,6 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) struct scoutfs_ioctl_statfs_more sfm; int ret; - if (get_user(sfm.valid_bytes, (__u64 __user *)arg)) - return -EFAULT; - super = kzalloc(sizeof(struct scoutfs_super_block), GFP_NOFS); if (!super) return -ENOMEM; @@ -890,8 +882,6 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) if (ret) goto out; - sfm.valid_bytes = min_t(u64, sfm.valid_bytes, - sizeof(struct scoutfs_ioctl_statfs_more)); sfm.fsid = le64_to_cpu(super->hdr.fsid); sfm.rid = sbi->rid; sfm.total_meta_blocks = le64_to_cpu(super->total_meta_blocks); @@ -902,7 +892,7 @@ static long scoutfs_ioc_statfs_more(struct file *file, unsigned long arg) if (ret) goto out; - if (copy_to_user((void __user *)arg, &sfm, sfm.valid_bytes)) + if (copy_to_user((void __user *)arg, &sfm, sizeof(sfm))) ret = -EFAULT; else ret = 0; diff --git a/kmod/src/ioctl.h b/kmod/src/ioctl.h index f0f0037d..940d67f3 100644 --- a/kmod/src/ioctl.h +++ b/kmod/src/ioctl.h @@ -215,18 +215,8 @@ struct scoutfs_ioctl_stage { /* * Give the user inode fields that are not otherwise visible. statx() * isn't always available and xattrs are relatively expensive. - * - * @valid_bytes stores the number of bytes that are valid in the - * structure. The caller sets this to the size of the struct that they - * understand. The kernel then fills and copies back the min of the - * size they and the user caller understand. The user can tell if a - * field is set if all of its bytes are within the valid_bytes that the - * kernel set on return. - * - * New fields are only added to the end of the struct. */ struct scoutfs_ioctl_stat_more { - __u64 valid_bytes; __u64 meta_seq; __u64 data_seq; __u64 data_version; @@ -356,21 +346,11 @@ struct scoutfs_ioctl_search_xattrs { /* * Give the user information about the filesystem. * - * @valid_bytes stores the number of bytes that are valid in the - * structure. The caller sets this to the size of the struct that they - * understand. The kernel then fills and copies back the min of the - * size they and the user caller understand. The user can tell if a - * field is set if all of its bytes are within the valid_bytes that the - * kernel set on return. - * * @committed_seq: All seqs up to and including this seq have been * committed. Can be compared with meta_seq and data_seq from inodes in * stat_more to discover if changes have been committed to disk. - * - * New fields are only added to the end of the struct. */ struct scoutfs_ioctl_statfs_more { - __u64 valid_bytes; __u64 fsid; __u64 rid; __u64 committed_seq; diff --git a/tests/src/stage_tmpfile.c b/tests/src/stage_tmpfile.c index 35cc403b..8ecfc042 100644 --- a/tests/src/stage_tmpfile.c +++ b/tests/src/stage_tmpfile.c @@ -113,7 +113,6 @@ int main(int argc, char **argv) } // get current data_version after fallocate's size extensions - stm.valid_bytes = sizeof(struct scoutfs_ioctl_stat_more); ret = ioctl(dest_fd, SCOUTFS_IOC_STAT_MORE, &stm); if (ret < 0) { perror("stat_more ioctl error"); diff --git a/utils/src/df.c b/utils/src/df.c index 585d658c..53e28b99 100644 --- a/utils/src/df.c +++ b/utils/src/df.c @@ -48,7 +48,6 @@ static int do_df(struct df_args *args) if (fd < 0) return fd; - sfm.valid_bytes = sizeof(struct scoutfs_ioctl_statfs_more); ret = ioctl(fd, SCOUTFS_IOC_STATFS_MORE, &sfm); if (ret < 0) { fprintf(stderr, "statfs_more returned %d: error %s (%d)\n", diff --git a/utils/src/stat.c b/utils/src/stat.c index a0679a71..6b8ae407 100644 --- a/utils/src/stat.c +++ b/utils/src/stat.c @@ -131,12 +131,10 @@ static int do_stat(struct stat_args *args) if (args->is_inode) { cmd = SCOUTFS_IOC_STAT_MORE; fields = inode_fields; - st.stm.valid_bytes = sizeof(struct scoutfs_ioctl_stat_more); pr = print_inode_field; } else { cmd = SCOUTFS_IOC_STATFS_MORE; fields = fs_fields; - st.sfm.valid_bytes = sizeof(struct scoutfs_ioctl_statfs_more); pr = print_fs_field; }