]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: fix bogus space reservation in xfs_iomap_write_allocate
authorChristoph Hellwig <hch@lst.de>
Tue, 16 Aug 2016 22:30:28 +0000 (08:30 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 16 Aug 2016 22:30:28 +0000 (08:30 +1000)
commitd52e1b8e84d44d0171492f5a83e668a311f69097
treed5869cee16b0b2a6c8b329964a830c98960a9511
parentf0352b121313b8a3dcd47c1d0e26d1728249fa9e
xfs: fix bogus space reservation in xfs_iomap_write_allocate

The space reservations was without an explaination in commit

    "Add error reporting calls in error paths that return EFSCORRUPTED"

back in 2003.  There is no reason to reserve disk blocks in the
transaction when allocating blocks for delalloc space as we already
reserved the space when creating the delalloc extent.

With this fix we stop running out of the reserved pool in
generic/229, which has happened for long time with small blocksize
file systems, and has increased in severity with the new buffered
write path.

[ dchinner: we still need to pass the block reservation into
  xfs_bmapi_write() to ensure we don't deadlock during AG selection.
  See commit 0c5412f ("xfs: pass total block res. as total
  xfs_bmapi_write() parameter") for more details on why this is
  necessary. ]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_iomap.c