Skip to content

ext4: don't use quota reservation for speculative metadata blocks

Eric Sandeen linux-ext4 1 version Applied

Status from this message: Applied to the ext4 patch queue, apologies for the delay.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 22 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3quota: use flags interface for dquot alloc/free spacefs/quota/dquot.c include/linux/quotaops.h+19 -142 replies
2/3quota: add the option to not fail with EDQUOT in block allocationfs/quota/dquot.c include/linux/quotaops.h+14 -12 replies
3/3ext4: don't use quota reservation for speculative metadata blocksfs/ext4/balloc.c fs/ext4/inode.c+24 -292 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ext4: don't use quota reservation for speculative metadata blocks

Because we can badly over-reserve metadata when we calculate worst-case, it complicates things for quota, since we must reserve and then claim later, retry on EDQUOT, etc. Quota is also a generally smaller pool than fs free blocks, so this over-reservation hurts more, and more often.

I'm of the opinion that it's not the worst thing to allow metadata to push a user slightly over quota. This simplifies the code and avoids the false quota rejections that result from worst-case speculation.

This patch series stops the speculative quota-charging for worst-case metadata requirements, and just charges quota when the blocks are allocated at writeout. It also is able to remove the try-again loop on EDQUOT.

The first 2 patches are quota infrastructure changes, to change __dquot_alloc/free_space to take a flags argument, and then add a NOFAIL option, so that metadata writes which tip us over quota can proceed.

The last patch makes the ext4 changes. The whole batch has been tested indirectly by running the xfstests suite with a hack to mount & enable quota prior to the test.

I also did a more specific test of fragmenting freespace and then doing a large delalloc write under quota; quota stopped me at the right amount of file IO, and then the writeout generated enough metadata (due to the fragmentation) that it put me slightly over quota, as expected.

Thanks,
-Eric