All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: qgroup: detect and fix leaked data reserved space
@ 2020-06-07  7:25 Qu Wenruo
  2020-06-07  7:25 ` [PATCH 1/2] btrfs: extent_io: fix qgroup reserved data space leakage when releasing a page Qu Wenruo
  2020-06-07  7:25 ` [PATCH 2/2] btrfs: qgroup: catch reserved space leakage at unmount time Qu Wenruo
  0 siblings, 2 replies; 12+ messages in thread
From: Qu Wenruo @ 2020-06-07  7:25 UTC (permalink / raw)
  To: linux-btrfs

There is an internal report complaining that qgroup is only half of the
limit, but they still get EDQUOT errors.

With some extra debugging patch added, it turns out that even fsstress
with 15 steps can sometimes cause qgroup reserved data space to leak.

This patch set is going to:
- Fix the reserved data space leakage
  Mostly caused by missing btrfs_qgroup_free_data() call in release
  page.
  As I thought a dirty page either goes through finish_ordered_io(),
  or get invalidated directly.
  But due to the designed of delayed finish_ordered_io(), we can
  still get dirty page get released directly.

- Add extra safenet to catch qgroup reserved space leakage.

The existing test case btrfs/022 can already catch the bug pretty
reliably.
I will add a specific case for fstests if needed.

Qu Wenruo (2):
  btrfs: extent_io: fix qgroup reserved data space leakage when
    releasing a page
  btrfs: qgroup: catch reserved space leakage at unmount time

 fs/btrfs/disk-io.c   |  6 ++++++
 fs/btrfs/extent_io.c | 34 +++++++++++++++++++++++++++-------
 fs/btrfs/qgroup.c    | 43 +++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/qgroup.h    |  2 +-
 4 files changed, 77 insertions(+), 8 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-09 18:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07  7:25 [PATCH 0/2] btrfs: qgroup: detect and fix leaked data reserved space Qu Wenruo
2020-06-07  7:25 ` [PATCH 1/2] btrfs: extent_io: fix qgroup reserved data space leakage when releasing a page Qu Wenruo
2020-06-08 15:17   ` Josef Bacik
2020-06-09  1:01     ` Qu Wenruo
2020-06-07  7:25 ` [PATCH 2/2] btrfs: qgroup: catch reserved space leakage at unmount time Qu Wenruo
2020-06-08  6:58   ` Nikolay Borisov
2020-06-08  7:22     ` Qu Wenruo
2020-06-08  7:20   ` Michał Mirosław
2020-06-08  7:24     ` Qu Wenruo
2020-06-08  7:44       ` Michał Mirosław
2020-06-08  9:37         ` Qu Wenruo
2020-06-09 18:46   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.