fix memory allocation in the cases we may need to align

when using the sg backend we crash w/ a SEGV in fio_sgio_getevents()
because of memory corruption from the IO. when we allocate the td's
backing store there's a possible post-allocation adjustment to page
align the buffers. however, the extra memory that this alignment may
need is not taken into account when allocating the buffer.

Tested:
  - the problematic fio file looks like
  fdha347:~# cat foo.fio
  [global]
  bs=64k
  thread
  rw=read
  size=100g
  time_based=1
  runtime=60
  iodepth=1

  [sdc]
  ioengine=sg
  filename=/dev/sg2
  numjobs=1

Signed-off-by: peter chang <dpf@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed