-
Notifications
You must be signed in to change notification settings - Fork 181
Disabled XFS rmapbt and reflink flags for reducing overhead #2562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,13 @@ func (nsc *Controller) syncFilesystems(ctx context.Context, nc *scyllav1alpha1.N | |
continue | ||
} | ||
|
||
changed, err := disks.MakeFS(ctx, nsc.executor, device, blockSize, string(fs.Type)) | ||
// Add default flags for XFS filesystem | ||
flags := fs.Flags | ||
if fs.Type == scyllav1alpha1.XFSFilesystem { | ||
flags = append(flags, "rmapbt=0", "reflink=0") | ||
} | ||
|
||
changed, err := disks.MakeFS(ctx, nsc.executor, device, blockSize, string(fs.Type), flags) | ||
Comment on lines
+38
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure it's intended, how would i enable those flags via fs.Flags if I wanted to? |
||
if err != nil { | ||
nsc.eventRecorder.Eventf( | ||
nc, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import ( | |
"k8s.io/utils/exec" | ||
) | ||
|
||
func MakeFS(ctx context.Context, executor exec.Interface, device string, blockSize int, fsType string) (bool, error) { | ||
func MakeFS(ctx context.Context, executor exec.Interface, device string, blockSize int, fsType string, xfsFlags []string) (bool, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are not xfs flags anymore |
||
existingFs, err := blkutils.GetFilesystemType(ctx, executor, device) | ||
if err != nil { | ||
return false, fmt.Errorf("can't determine existing filesystem type at %q: %w", device, err) | ||
|
@@ -35,8 +35,16 @@ func MakeFS(ctx context.Context, executor exec.Interface, device string, blockSi | |
"-b", fmt.Sprintf("size=%d", blockSize), | ||
// no discard | ||
"-K", | ||
device, | ||
} | ||
|
||
// Add XFS-specific flags if filesystem type is xfs | ||
if fsType == "xfs" { | ||
for _, flag := range xfsFlags { | ||
args = append(args, "-m", flag) | ||
} | ||
} | ||
Comment on lines
+41
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't |
||
|
||
args = append(args, device) | ||
stdout, stderr, err := oexec.RunCommand(ctx, executor, "mkfs", args...) | ||
if err != nil { | ||
return false, fmt.Errorf("can't run mkfs with args %v: %w, stdout: %q, stderr: %q", args, err, stdout.String(), stderr.String()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API changes requires regenerating autogenerated code.