diff options
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 562b57b7a4a3..ac3192a433f9 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -2041,8 +2041,7 @@ xfs_fs_eofblocks_from_user( if (src->eof_flags & ~XFS_EOF_FLAGS_VALID) return -EINVAL; - if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) || - memchr_inv(src->pad64, 0, sizeof(src->pad64))) + if (memchr_inv(src->pad64, 0, sizeof(src->pad64))) return -EINVAL; dst->eof_flags = src->eof_flags; @@ -2062,6 +2061,12 @@ xfs_fs_eofblocks_from_user( if (!gid_valid(dst->eof_gid)) return -EINVAL; } + + if (src->eof_flags & XFS_EOF_FLAGS_LIMIT) + dst->nr_to_scan = min_t(int, src->eof_limit, INT_MAX); + else if (src->eof_limit != 0) + return -EINVAL; + return 0; } |