fspacectl(2): result of rmsr.r_offset for a success and non-partial operation
Date: Fri, 20 Aug 2021 15:23:57 UTC
There were some recent discussion in https://reviews.freebsd.org/D31604 around the returned value of rmsr.r_offset. For a complete and successful operation, rmsr.r_len is set to 0. Regarding rmsr.r_offset, the bottom line is to have rmsr.r_offset being no greater than current file size in case rmsr.r_offset is greater than file size, while leaving rmsr.r_offset to be within EOF in case rqsr.r_offset is not beyond EOF. With the current approach, rmsr.r_offset is loosely defined as file system is free to set it to some value as long as it is neither smaller than rqsr.r_offset (in case rqsr.r_offset is within EOF), or beyond EOF (in case rqsr.r_offset is beyond EOF). Do you think it is a good idea to make it stricter in case the call succeeds and rmsr.r_len == 0 (i.e. a complete operation)? If that is the case, what if we set rmsr.r_offset to be rqsr.r_offset + rqsr.r_len? Ka Ho