LASSERT(ost);
rc = dt_statfs(env, ost->ltd_ost, sfs);
+
+ if (rc == 0 && ((sfs->os_state & OS_STATE_ENOSPC) ||
+ (sfs->os_state & OS_STATE_ENOINO && sfs->os_fprecreated == 0)))
+ RETURN(-ENOSPC);
+
if (rc && rc != -ENOTCONN)
CERROR("%s: statfs: rc = %d\n", lod2obd(d)->obd_name, rc);
#define LOV_CREATE_RESEED_MIN 2000
/**
- * Check if an OST is full.
- *
- * Check whether an OST should be considered full based
- * on the given statfs data.
- *
- * \param[in] msfs statfs data
- *
- * \retval false not full
- * \retval true full
- */
-static int inline lod_qos_dev_is_full(struct obd_statfs *msfs)
-{
- __u64 used;
- int bs = msfs->os_bsize;
-
- LASSERT(((bs - 1) & bs) == 0);
-
- /* the minimum of 0.1% used blocks and 1GB bytes. */
- used = min_t(__u64, (msfs->os_blocks - msfs->os_bfree) >> 10,
- 1 << (31 - ffs(bs)));
- return (msfs->os_bavail < used);
-}
-
-/**
* Initialize temporary OST-in-use array.
*
* Allocate or extend the array used to mark targets already assigned to a new
}
/*
- * skip full devices
- */
- if (lod_qos_dev_is_full(sfs)) {
- QOS_DEBUG("#%d is full\n", ost_idx);
- goto out_return;
- }
-
- /*
* We expect number of precreated objects in f_ffree at
* the first iteration, skip OSPs with no objects ready
*/
/*
* do not put >1 objects on a single OST
*/
- if (speed && lod_qos_is_ost_used(env, ost_idx, stripe_idx))
+ if (lod_qos_is_ost_used(env, ost_idx, stripe_idx))
goto out_return;
o = lod_qos_declare_object_on(env, m, ost_idx, th);
*/
lod_qos_ost_in_use(env, stripe_idx, ost_idx);
stripe[stripe_idx] = o;
+ OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_LOV_CREATE_RACE, 2);
stripe_idx++;
*s_idx = stripe_idx;
if (!cfs_bitmap_check(lod->lod_ost_bitmap, osts->op_array[i]))
continue;
+ ost = OST_TGT(lod, osts->op_array[i]);
+ ost->ltd_qos.ltq_usable = 0;
+
rc = lod_statfs_and_check(env, lod, osts->op_array[i], sfs);
if (rc) {
/* this OSP doesn't feel well */
continue;
}
- /*
- * skip full devices
- */
- if (lod_qos_dev_is_full(sfs))
- continue;
-
if (sfs->os_state & OS_STATE_DEGRADED)
continue;
osts->op_array[i] == 0)
continue;
- ost = OST_TGT(lod, osts->op_array[i]);
ost->ltd_qos.ltq_usable = 1;
lod_qos_calc_weight(lod, osts->op_array[i]);
total_weight += ost->ltd_qos.ltq_weight;