diff options
| author | Mark Fasheh <[email protected]> | 2014-08-18 21:01:17 +0000 |
|---|---|---|
| committer | Chris Mason <[email protected]> | 2014-09-17 20:38:19 +0000 |
| commit | 0b4699dcb65c2cff793210b07f40b98c2d423a43 (patch) | |
| tree | 5acf4f368d2245924049f2f6276e20f43065c5ad /fs/btrfs/dev-replace.c | |
| parent | Btrfs: show real function name in btrfs workqueue tracepoint (diff) | |
| download | kernel-0b4699dcb65c2cff793210b07f40b98c2d423a43.tar.gz kernel-0b4699dcb65c2cff793210b07f40b98c2d423a43.zip | |
btrfs: don't go readonly on existing qgroup items
btrfs_drop_snapshot() leaves subvolume qgroup items on disk after
completion. This can cause problems with snapshot creation. If a new
snapshot tries to claim the deleted subvolumes id, btrfs will get -EEXIST
from add_qgroup_item() and go read-only. The following commands will
reproduce this problem (assume btrfs is on /dev/sda and is mounted at
/btrfs)
mkfs.btrfs -f /dev/sda
mount -t btrfs /dev/sda /btrfs/
btrfs quota enable /btrfs/
btrfs su sna /btrfs/ /btrfs/snap
btrfs su de /btrfs/snap
sleep 45
umount /btrfs/
mount -t btrfs /dev/sda /btrfs/
We can fix this by catching -EEXIST in add_qgroup_item() and
initializing the existing items. We have the problem of orphaned
relation items being on disk from an old snapshot but that is outside
the scope of this patch.
Signed-off-by: Mark Fasheh <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
