fix memory allocation in the cases we may need to align
authorpeter chang <dpf@google.com>
Wed, 24 Apr 2013 22:32:25 +0000 (16:32 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Apr 2013 22:32:25 +0000 (16:32 -0600)
commitfd8a09b8f4a7e0da67fe64cfb1d023bfb500d7eb
tree9fd952ebba33511395b21c35e9ed78aabb4649e4
parentc5d72b39b137e99a137f52aebc7debc15e671608
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>
backend.c