-
Notifications
You must be signed in to change notification settings - Fork 142
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
mdraid: Add 'bitmap' option to MDRaidCreate method #1124
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,6 +561,7 @@ handle_mdraid_create (UDisksManager *_object, | |
const gchar **disks = NULL; | ||
guint disks_top = 0; | ||
gboolean success = FALSE; | ||
const gchar *option_bitmap = NULL; | ||
|
||
if (!udisks_daemon_util_get_caller_uid_sync (manager->daemon, | ||
invocation, | ||
|
@@ -765,7 +766,16 @@ handle_mdraid_create (UDisksManager *_object, | |
} | ||
disks[disks_top] = NULL; | ||
|
||
if (!bd_md_create (array_name, arg_level, disks, 0, NULL, FALSE, arg_chunk, NULL, &error)) | ||
g_variant_lookup (arg_options, "bitmap", "^&ay", &option_bitmap); | ||
if (!(g_strcmp0 (option_bitmap, "none") == 0 || g_strcmp0 (option_bitmap, "internal") == 0)) | ||
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. One more thing, revealed by the failed tests - in case of a NULL value this check should be skipped. |
||
{ | ||
g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, | ||
"Only values 'none' and 'internal' are currently supported for 'bitmap'."); | ||
success = FALSE; | ||
goto out; | ||
} | ||
|
||
if (!bd_md_create (array_name, arg_level, disks, 0, NULL, g_strcmp0 (option_bitmap, "internal") == 0, arg_chunk, NULL, &error)) | ||
{ | ||
g_prefix_error (&error, "Error creating RAID array: "); | ||
udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you please explicitly state the values accepted, for the sake of completeness? I.e. The value for the bitmap, currently only the values 'none' and 'internal' are supported.
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.
Also, looking at the
mdadm
manpage, in casebd_md_create(bitmap=False)
, libblockdev doesn't add any--bitmap=
option, leaving the logic on automatic mdadm rule:So either the values in UDisks should read 'auto' and 'internal', or we should change
bd_md_create()
to accept values of 'none', 'auto' and 'internal'. Intentionally omitting 'clustered' and filename as those we don't want to support.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.
Oh, interesting, let's bring in the experts.
@mauelsha, from our discussion in Brno I had the impression that
mdadm
will never use a bitmap but that it is always a good idea to use one. Now the man page seems to say that a bitmap is not always a good idea, and thatmdadm
does in fact decides to use a bitmap exactly when it is a good idea.Can you clarify?
Right now I am thinking that we don't need to change anything, after all. New mdraid devices will have a bitmap or not as decided by the mdraid maintainers, and Cockpit allows it to be adjusted in case the maintainers are wrong in certain situations.