X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flod%2Flod_qos.c;h=51d66033cb91dac3413362be93189c7ef3c6cf3a;hp=e7b1de0771ab536982500ba27d0f8ffdb6d91a28;hb=7b124fef762f5adc4cf5fcf7fa21987655493e19;hpb=22af4dcd80c3f6fb47080e2d39e6f165f70e7472 diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index e7b1de0..51d6603 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -159,6 +159,10 @@ static int lod_statfs_and_check(const struct lu_env *env, struct lod_device *d, if (rc && rc != -ENOTCONN) CERROR("%s: statfs: rc = %d\n", lod2obd(d)->obd_name, rc); + /* If the OST is readonly then we can't allocate objects there */ + if (sfs->os_state & OS_STATE_READONLY) + rc = -EROFS; + /* check whether device has changed state (active, inactive) */ if (rc != 0 && ost->ltd_active) { /* turned inactive? */ @@ -771,7 +775,7 @@ repeat_find: /* * try to use another OSP if this one is degraded */ - if (sfs->os_state == OS_STATE_DEGRADED && speed < 2) { + if (sfs->os_state & OS_STATE_DEGRADED && speed < 2) { QOS_DEBUG("#%d: degraded\n", ost_idx); continue; }