Skip to content

Conversation

@Syx5290
Copy link

@Syx5290 Syx5290 commented Jun 20, 2024

Fix the issue where compiling containers-storage with exclude_disk_quota enabled on the Linux CGO platform results in an error indicating that d.quotaCtl.GetDiskUsage is not defined.

root@syx:/storage# make binary
go build -compiler gc -tags " libdm_no_deferred_remove   exclude_disk_quota"  ./cmd/containers-storage
# github.com/containers/storage/drivers/overlay
drivers/overlay/overlay.go:1930:35: undefined: quota.BackingFsBlockDeviceLink
drivers/overlay/overlay_cgo.go:18:21: d.quotaCtl.GetDiskUsage undefined (type *quota.Control has no field or me
thod GetDiskUsage)
make: *** [Makefile:41: containers-storage] Error 1

Certainly, the reason I compiled it this way was an attempt to disable the xfs_quota limit feature during the compilation of CRI-O, which led to this issue. When I tried to use the exclude_disk_quota build argument, I should have chosen to compile the overlay_nocgo.go file.

root@syx:/storage# git status
HEAD detached at origin/release-1.51
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   Makefile
        modified:   drivers/overlay/overlay_cgo.go
        modified:   drivers/overlay/overlay_nocgo.go
        modified:   drivers/quota/projectquota.go
        modified:   drivers/quota/projectquota_unsupported.go

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        drivers/quota/projectquota_supported.go

no changes added to commit (use "git add" and/or "git commit -a")
root@syx:/storage# make binary
go build -compiler gc -tags " libdm_no_deferred_remove   exclude_disk_quota"  ./cmd/containers-storage
root@syx:/storage# 

…ota enabled on the Linux CGO platform results in an error indicating that d.quotaCtl.GetDiskUsage is not defined.

Signed-off-by: Shi Xue <shixue@cestc.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xuegege5290
Once this PR has been reviewed and has the lgtm label, please assign vrothberg for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I don’t think the quota build tag should affect whether getComposeFsHelper and others are included; this should probably be split into more files or something.

@Syx5290
Copy link
Author

Syx5290 commented Jun 20, 2024

Thanks!

I don’t think the quota build tag should affect whether getComposeFsHelper and others are included; this should probably be split into more files or something.

I don't understand what you mean by getComposeFsHelper. I only know that when I use the XFS file system, the overlay driver, and enable the quota, I need to use exclude_disk_quota to disable the quota feature, and then overlay_cgo.go will be compiled, and d.quotaCtl.GetDiskUsage needs to be referenced. You said 'this should probably be split into more files or something,' what exactly needs to be done? I am very willing to listen.

@rhatdan
Copy link
Member

rhatdan commented Jun 20, 2024

You need to create two new files for disk quota. and not just tread no_disk_quota as no nocgo

@Syx5290
Copy link
Author

Syx5290 commented Jun 21, 2024

You need to create two new files for disk quota. and not just tread no_disk_quota as no nocgo

I've got it., thanks. I will give it a try.

@rhatdan rhatdan closed this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants