Skip to content

Commit fd034bd

Browse files
committed
fix: delete subvolume will automatically delete the associated qgroup
Signed-off-by: obarisk <obarisk@gmail.com>
1 parent 4e7127f commit fd034bd

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

storage/drivers/btrfs/btrfs.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131

3232
"github.com/docker/go-units"
3333
"github.com/opencontainers/selinux/go-selinux/label"
34-
"github.com/sirupsen/logrus"
3534
graphdriver "go.podman.io/storage/drivers"
3635
"go.podman.io/storage/internal/tempdir"
3736
"go.podman.io/storage/pkg/directory"
@@ -279,21 +278,6 @@ func subvolDelete(dirpath, name string, quotaEnabled bool) error {
279278
return fmt.Errorf("recursively walking subvolumes for %s failed: %w", dirpath, err)
280279
}
281280

282-
if quotaEnabled {
283-
if qgroupid, err := subvolLookupQgroup(fullPath); err == nil {
284-
var args C.struct_btrfs_ioctl_qgroup_create_args
285-
args.qgroupid = C.__u64(qgroupid)
286-
287-
_, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_CREATE,
288-
uintptr(unsafe.Pointer(&args)))
289-
if errno != 0 {
290-
logrus.Errorf("Failed to delete btrfs qgroup %v for %s: %v", qgroupid, fullPath, errno.Error())
291-
}
292-
} else {
293-
logrus.Errorf("Failed to lookup btrfs qgroup for %s: %v", fullPath, err.Error())
294-
}
295-
}
296-
297281
// all subvolumes have been removed
298282
// now remove the one originally passed in
299283
for i, c := range []byte(name) {

0 commit comments

Comments
 (0)