if (body && rc == -ENOSPC) {
oscc->oscc_last_id = body->oa.o_id;
oscc->oscc_grow_count = OST_MIN_PRECREATE;
+
+ if ((body->oa.o_valid & OBD_MD_FLFLAGS) &&
+ (body->oa.o_flags & OBD_FL_NOSPC_BLK))
+ oscc->oscc_flags |= OSCC_FLAG_NOSPC_BLK;
+ else
+ rc = 0;
}
}
cfs_spin_unlock(&oscc->oscc_lock);
/* Handle critical states first */
cfs_spin_lock(&oscc->oscc_lock);
- if (oscc->oscc_flags & OSCC_FLAG_NOSPC ||
+ if (oscc->oscc_flags & OSCC_FLAG_NOSPC_BLK ||
oscc->oscc_flags & OSCC_FLAG_RDONLY ||
oscc->oscc_flags & OSCC_FLAG_EXITING)
GOTO(out, rc = 1000);
/* Return 0, if we have at least one object - bug 22884 */
rc = oscc_has_objects_nolock(oscc, 1) ? 0 : 1;
+ if (oscc->oscc_flags & OSCC_FLAG_NOSPC)
+ GOTO(out, (rc == 0) ? 0 : 1000);
+
/* Do not check for OSCC_FLAG_CREATING flag here, let
* osc_precreate() call oscc_internal_create() and
* adjust oscc_grow_count bug21563 */
if (oscc->oscc_flags & OSCC_FLAG_EXITING)
GOTO(out_wake, rc = -EIO);
- if (oscc->oscc_flags & OSCC_FLAG_NOSPC)
+ if (oscc->oscc_flags & OSCC_FLAG_NOSPC_BLK)
GOTO(out_wake, rc = -ENOSPC);
if (oscc->oscc_flags & OSCC_FLAG_RDONLY)
if (rc == 0 || rc == -ENOSPC) {
struct obd_connect_data *ocd;
- if (rc == -ENOSPC)
+ if (rc == -ENOSPC) {
oscc->oscc_flags |= OSCC_FLAG_NOSPC;
+ if ((oa->o_valid & OBD_MD_FLFLAGS) &&
+ (oa->o_flags & OBD_FL_NOSPC_BLK))
+ oscc->oscc_flags |= OSCC_FLAG_NOSPC_BLK;
+ }
oscc->oscc_flags &= ~OSCC_FLAG_RECOVERING;
oscc->oscc_last_id = oa->o_id;
break;
}
- if (oscc->oscc_flags & OSCC_FLAG_NOSPC) {
+ if (oscc->oscc_flags & OSCC_FLAG_NOSPC_BLK) {
rc = -ENOSPC;
cfs_spin_unlock(&oscc->oscc_lock);
break;
break;
}
+ if (oscc->oscc_flags & OSCC_FLAG_NOSPC) {
+ rc = -ENOSPC;
+ cfs_spin_unlock(&oscc->oscc_lock);
+ break;
+ }
+
cfs_spin_unlock(&oscc->oscc_lock);
}