Index: lib/libc/sys/fspacectl.2 =================================================================== --- lib/libc/sys/fspacectl.2 +++ lib/libc/sys/fspacectl.2 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 4, 2021 +.Dd August 18, 2021 .Dt FSPACECTL 2 .Os .Sh NAME @@ -67,6 +67,12 @@ .Fa spacectl_range structure it points to is updated to contain the unprocessed operation range after the system call returns. +If +.Fa "rmsr->r_len" +is zero after the system call returns success, +.Fa "rmsr->r_offset" +should be ignored. +The file descriptor's file offset is not used or modified by the system call. Both .Fa rqsr and @@ -92,9 +98,9 @@ .Fa rqsr argument. The -.Va "rqsr->r_offset" +.Fa "rqsr->r_offset" has to be a value greater than or equal to 0, and the -.Va "rqsr->r_len" +.Fa "rqsr->r_len" has to be a value greater than 0. .Pp If the file system supports hole-punching, @@ -137,6 +143,12 @@ .Fa "range->r_len" argument was less than or equal to zero. .It Bq Er EINVAL +The value of +.Fa "range->r_offset" + +.Fa "range->r_len" +is greater than +.Dv OFF_MAX . +.It Bq Er EINVAL An invalid or unsupported flag is included in .Fa flags . .It Bq Er EINVAL Index: sys/kern/vfs_default.c =================================================================== --- sys/kern/vfs_default.c +++ sys/kern/vfs_default.c @@ -1186,7 +1186,8 @@ break; } out: - *ap->a_offset = offset; + if (error != 0 || len != 0) + *ap->a_offset = offset; *ap->a_len = len; return (error); }