]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable
authorNikolay Borisov <nborisov@suse.com>
Thu, 5 Jul 2018 11:50:48 +0000 (14:50 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:45 +0000 (13:12 +0200)
commit3085f1c6919435b421cae18338326951bce35d2e
tree2b5860755e751a2187879cdcfb0e5c3aae4475ce
parent0d0b58de0090d4ba70205a4c54bb2a395bd1ae19
btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable

Commit 9ea02fcbd82e ("btrfs: Move qgroup rescan on quota enable to
btrfs_quota_enable") not only resulted in an easier to follow code but
it also introduced a subtle bug. It changed the timing when the initial
transaction rescan was happening:

- before the commit: it would happen after transaction commit had occured
- after the commit: it might happen before the transaction was committed

This results in failure to correctly rescan the quota since there could
be data which is still not committed on disk.

This patch aims to fix this by moving the transaction creation/commit
inside btrfs_quota_enable, which allows to schedule the quota commit
after the transaction has been committed.

Fixes: 9ea02fcbd82e ("btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable")
Reported-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Link: https://marc.info/?l=linux-btrfs&m=152999289017582
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h