Commit 663244e
btrfs-progs: qgroup show: use sysfs to detect inconsistent state early
Currently if "btrfs qgroup show" detects the qgroup is in an
inconsistent state, it will print a warning:
WARNING: qgroup data inconsistent, rescan recommended
But the detection is based on the tree search ioctl, and qgroup tree is
only updated at transaction commit time.
This means if qgroup is marked inconsistent, and the transaction is not
commit, there can be a time window as long as 30s before "btrfs qgroup
show" gives a proper warning about inconsistent qgroup numbers.
To address this, use the
'/sys/fs/btrfs/<fsid>/qgroup/inconsistent' file to do extra check.
That file is updated at real time, thus there is no delay, and can give
an early warning about inconsistent qgroup numbers.
Link: https://bugzilla.suse.com/show_bug.cgi?id=1235765
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent c7fce0e commit 663244e
1 file changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
1610 | 1611 | | |
1611 | 1612 | | |
1612 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
1613 | 1639 | | |
1614 | 1640 | | |
1615 | 1641 | | |
| |||
1622 | 1648 | | |
1623 | 1649 | | |
1624 | 1650 | | |
| 1651 | + | |
| 1652 | + | |
1625 | 1653 | | |
1626 | 1654 | | |
1627 | 1655 | | |
| |||
0 commit comments