The following patch queries the sector size of the underlying device so
that we can size the write buffer appropriately. Without this patch, we
try to do an O_DIRECT write of 1KB to a device that has a sector size of
4KB. This returns EINVAL, of course. I also noticed that the test was
not checking the right fields for the return code. It was checking the
original iocb's nbytes field instead of event->res. So, I fixed that.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>