On 01/05 2014 08:36 AM, Josef Bacik wrote: > > On 01/03/2014 05:17 PM, Andreas Dilger wrote: >> Shouldn't this be -EOPNOTSUPP, since -EINVAL is for incorrect >> arguments, which isn't the case here. >> > I think we want to be consistent with previous kernels which would > return -EINVAL if whence wasn't set properly, hopefully breaking as few > userspace stuff as possible. Thanks, It seems like that this fix would have a bit influence to man page of lseek(2) as it suppose to: EINVAL whence is not valid. Or: the resulting file offset would be negative, or beyond the end of a seekable device. Where probably need an update to reflect this change regardless of whether return -EINVAL or -EOPNOTSUPP IMHO. Moreover, Solaris/FreeBSD use {f}pathconf(2) syscalls to detect if a file system is support SEEK_HOLE function or not, maybe Glibc/GNULib folks would like to couple lseek(..., SEEK_HOLE) to {f}pathconf(3) in the future, which could make the userspace stuff a bit more flexible across different OS. So, I gone through their man pages and in this case, seems both of them will return -EINVAL if call to {f}pathconf(2) with _PC_MIN_HOLE_SIZE is failed: Solaris: http://docs.oracle.com/cd/E23824_01/html/821-1463/pathconf-2.html FreeBSD: http://www.freebsd.org/cgi/man.cgi?query=pathconf&sektion=2 Thanks, -Jeff -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html