r = config_client(client_id, !got_value, option, value, *css);
} else if (command == "scrub start" ||
command == "scrub_start") {
- if (whoami != 0) {
+ if (!is_active()) {
+ *css << "MDS is not active";
+ r = -CEPHFS_EINVAL;
+ goto out;
+ }
+ else if (whoami != 0) {
*css << "Not rank 0";
r = -CEPHFS_EXDEV;
goto out;
}));
return;
} else if (command == "scrub abort") {
- if (whoami != 0) {
+ if (!is_active()) {
+ *css << "MDS is not active";
+ r = -CEPHFS_EINVAL;
+ goto out;
+ }
+ else if (whoami != 0) {
*css << "Not rank 0";
r = -CEPHFS_EXDEV;
goto out;
}));
return;
} else if (command == "scrub pause") {
- if (whoami != 0) {
+ if (!is_active()) {
+ *css << "MDS is not active";
+ r = -CEPHFS_EINVAL;
+ goto out;
+ }
+ else if (whoami != 0) {
*css << "Not rank 0";
r = -CEPHFS_EXDEV;
goto out;
}));
return;
} else if (command == "scrub resume") {
- if (whoami != 0) {
+ if (!is_active()) {
+ *css << "MDS is not active";
+ r = -CEPHFS_EINVAL;
+ goto out;
+ }
+ else if (whoami != 0) {
*css << "Not rank 0";
r = -CEPHFS_EXDEV;
goto out;