mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-16 09:58:21 +00:00
add admin policy check for user operation
This commit is contained in:
@@ -698,7 +698,7 @@ impl ECStore {
|
||||
futures.push(async move {
|
||||
let mut ask_disks = get_list_quorum(&opts.ask_disks, set.set_drive_count as i32);
|
||||
if ask_disks == -1 {
|
||||
let new_disks = get_quorum_disks(&disks, &infos, (disks.len() + 1) / 2);
|
||||
let new_disks = get_quorum_disks(&disks, &infos, disks.len().div_ceil(2));
|
||||
if !new_disks.is_empty() {
|
||||
disks = new_disks;
|
||||
} else {
|
||||
@@ -1156,13 +1156,7 @@ async fn merge_entry_channels(
|
||||
if let Some(entry) = &best {
|
||||
let mut versions = Vec::with_capacity(to_merge.len() + 1);
|
||||
|
||||
let mut has_xl = {
|
||||
if let Ok(meta) = entry.clone().xl_meta() {
|
||||
Some(meta)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
};
|
||||
let mut has_xl = { entry.clone().xl_meta().ok() };
|
||||
|
||||
if let Some(x) = &has_xl {
|
||||
versions.push(x.versions.clone());
|
||||
@@ -1229,7 +1223,7 @@ impl SetDisks {
|
||||
|
||||
let mut ask_disks = get_list_quorum(&opts.ask_disks, self.set_drive_count as i32);
|
||||
if ask_disks == -1 {
|
||||
let new_disks = get_quorum_disks(&disks, &infos, (disks.len() + 1) / 2);
|
||||
let new_disks = get_quorum_disks(&disks, &infos, disks.len().div_ceil(2));
|
||||
if !new_disks.is_empty() {
|
||||
disks = new_disks;
|
||||
ask_disks = 1;
|
||||
|
||||
Reference in New Issue
Block a user