engine: e4defrag fix error reporting
authorDmitry Monakhov <dmonakhov@openvz.org>
Fri, 7 Apr 2017 04:56:49 +0000 (07:56 +0300)
committerDmitry Monakhov <dmonakhov@openvz.org>
Fri, 7 Apr 2017 04:56:49 +0000 (07:56 +0300)
commit3cbd6bb9f5cf5a2779e02e4612506de41aca8251
treecba32a5f1451f80ae3afa511fc1dcb38894093cb
parente07a8a2281c7a5a0ec4eb8e8e66601ca1f9f71bb
engine: e4defrag fix error reporting

IOC_MOVE_EXT returns 0 if the requested range is beyond i_size. In that
case we currently set io_u->resid = io_u->xfer_buflen, but
io_queue_event() interprets that as a zero read and fails with EIO. We
definitely do not want this behaviour so set io_u->error explicitly to
EINVAL so we fail with that instead when we are in this scenario.
engines/e4defrag.c