freebsd-dev/module
LOLi 047187c1bd Fix size inflation in spa_get_worst_case_asize()
When we try assign a new transaction to a TXG we must know beforehand
if there is sufficient free space on disk. This is to decide,
in dmu_tx_assign(), if we should reject the TX with ENOSPC.

We rely on spa_get_worst_case_asize() to inflate the size of our
logical writes by a factor of spa_asize_inflation which is
calculated as:

   (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24

The problem with the current implementation is that we don't take
into account what happens with very small writes on VDEVs with large
physical block sizes.
Consider the case of writes to a dataset with recordsize=512,
copies=3 on a VDEV with ashift=13 (usually SSD with 8K block size):
every logical IO will end up allocating 3 * 8K = 24K on disk, so 512
bytes multiplied by 48, which is double the size we account for.
If we allow this kind of writes to be assigned a TX it is possible,
when the pool is almost full, to trigger an allocation failure
(ENOSPC) in the ZIO pipeline, which will in turn result in the whole
pool being suspended.

The bug is fixed by using, in spa_get_worst_case_asize(), the MAX()
value chosen between the logical io size from zfs_write() and the
maximum physical block size used among our VDEVs.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #5941
2017-04-10 15:28:21 -07:00
..
avl Fix uninitialized variable in avl_add() 2016-07-25 14:21:34 -07:00
icp [icp] fpu and asm cleanup for linux 2017-03-07 12:59:31 -08:00
nvpair OpenZFS 7812 - Remove gender specific language 2017-02-24 11:07:04 -08:00
unicode codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zcommon OpenZFS 6931 - lib/libzfs: cleanup gcc warnings 2017-02-07 14:02:27 -08:00
zfs Fix size inflation in spa_get_worst_case_asize() 2017-04-10 15:28:21 -07:00
zpios codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
.gitignore module/.gitignore: Add *.dwo (#4580) 2016-05-02 09:07:04 -07:00
Makefile.in GZIP compression offloading with QAT accelerator 2017-03-22 17:58:47 -07:00