]> Git Repo - linux.git/commit - fs/btrfs/qgroup.h
btrfs: qgroup: check generation when recording simple quota delta
authorBoris Burkov <[email protected]>
Tue, 28 Mar 2023 22:45:20 +0000 (15:45 -0700)
committerDavid Sterba <[email protected]>
Thu, 12 Oct 2023 14:44:11 +0000 (16:44 +0200)
commitbd7c1ea3a302aba727a1ced9937ec84c6407724e
tree753922744491aae09f86d86c4d6f8f9e8fca1ba4
parent5343cd9364ea26c9f4f78896a87ed1b5b5e652d9
btrfs: qgroup: check generation when recording simple quota delta

Simple quotas count extents only from the moment the feature is enabled.
Therefore, if we do something like:

1. create subvol S
2. write F in S
3. enable quotas
4. remove F
5. write G in S

then after 3. and 4. we would expect the simple quota usage of S to be 0
(putting aside some metadata extents that might be written) and after
5., it should be the size of G plus metadata. Therefore, we need to be
able to determine whether a particular quota delta we are processing
predates simple quota enablement.

To do this, store the transaction id when quotas were enabled. In
fs_info for immediate use and in the quota status item to make it
recoverable on mount. When we see a delta, check if the generation of
the extent item is less than that of quota enablement. If so, we should
ignore the delta from this extent.

Signed-off-by: Boris Burkov <[email protected]>
Signed-off-by: David Sterba <[email protected]>
fs/btrfs/accessors.h
fs/btrfs/extent-tree.c
fs/btrfs/fs.h
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h
include/uapi/linux/btrfs_tree.h
This page took 0.046006 seconds and 4 git commands to generate.