zfs/module
Brian Behlendorf 6df43169b3
Fix ENOSPC when unlinking multiple files from full pool
When unlinking multiple files from a pool at 100% capacity, it was
possible for ENOSPC to be returned after the first unlink.  e.g.

    rm -f /mnt/fs/test1.0.0 /mnt/fs/test1.1.0 /mnt/fs/test1.2.0
    rm: cannot remove '/mnt/fs/test1.1.0': No space left on device
    rm: cannot remove '/mnt/fs/test1.2.0': No space left on device

After waiting for the pending deferred frees from the first unlink to
be processed the remaining files can then be unlinked.  This is caused
by the quota limit in dsl_dir_tempreserve_impl() being temporarily
decreased to the allocatable pool capacity less any deferred free
space.

This is resolved using the existing mechanism of returning ERESTART
when over quota as long as we know enough space will shortly be
available after processing the pending deferred frees.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13172
2022-03-08 09:16:35 -08:00
..
avl Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
icp module: icp: remove useless assert 2022-02-18 09:34:18 -08:00
lua Use _Noreturn (C11; GNU89) properly 2022-03-04 16:25:22 -08:00
nvpair module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
os Expose additional file level attributes 2022-03-07 17:52:03 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zcommon Flex non-pretty-printed properties and raw-/pretty-print remaining ones 2022-03-04 12:08:33 -08:00
zfs Fix ENOSPC when unlinking multiple files from full pool 2022-03-08 09:16:35 -08:00
zstd Re-apply 6ba2e72b, silence lint 2022-03-01 13:56:00 -08:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Explode zstd 1.4.5 into separate upstream files 2022-03-01 13:55:12 -08:00
Makefile.in Re-apply 6ba2e72b, silence lint 2022-03-01 13:56:00 -08:00