Skip to content
Commit 9960f851 authored by Andrei Vagin's avatar Andrei Vagin Committed by Nicholas Bellinger
Browse files

target: don't call an unmap callback if a range length is zero



If a length of a range is zero, it means there is nothing to unmap
and we can skip this range.

Here is one more reason, why we have to skip such ranges.  An unmap
callback calls file_operations->fallocate(), but the man page for the
fallocate syscall says that fallocate(fd, mode, offset, let) returns
EINVAL, if len is zero. It means that file_operations->fallocate() isn't
obligated to handle zero ranges too.

Signed-off-by: default avatarAndrei Vagin <avagin@openvz.org>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent ce512d79
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment