fed->fed_group = data->ocd_group;
data->ocd_connect_flags &= OST_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= OST_CONNECT_SUPPORTED2;
data->ocd_version = LUSTRE_VERSION_CODE;
/* Kindly make sure the SKIP_ORPHAN flag is from MDS. */
else if (data->ocd_connect_flags & OBD_CONNECT_SKIP_ORPHAN)
RETURN(-EPROTO);
- if (ofd_grant_param_supp(exp)) {
- exp->exp_filter_data.fed_pagesize = data->ocd_blocksize;
- /* ocd_{blocksize,inodespace} are log2 values */
- data->ocd_blocksize = ofd->ofd_blockbits;
- data->ocd_inodespace = ofd->ofd_dt_conf.ddp_inodespace;
- /* ocd_grant_extent is in 1K blocks */
- data->ocd_grant_extent = ofd->ofd_dt_conf.ddp_grant_frag >> 10;
+ /* Determine optimal brw size before calculating grant */
+ if (OBD_FAIL_CHECK(OBD_FAIL_OST_BRW_SIZE)) {
+ data->ocd_brw_size = 65536;
+ } else if (OCD_HAS_FLAG(data, BRW_SIZE)) {
+ if (data->ocd_brw_size > ofd->ofd_brw_size)
+ data->ocd_brw_size = ofd->ofd_brw_size;
+ if (data->ocd_brw_size == 0) {
+ CERROR("%s: cli %s/%p ocd_connect_flags: "LPX64
+ " ocd_version: %x ocd_grant: %d ocd_index: %u "
+ "ocd_brw_size is unexpectedly zero, "
+ "network data corruption?"
+ "Refusing connection of this client\n",
+ exp->exp_obd->obd_name,
+ exp->exp_client_uuid.uuid,
+ exp, data->ocd_connect_flags, data->ocd_version,
+ data->ocd_grant, data->ocd_index);
+ RETURN(-EPROTO);
+ }
}
- if (data->ocd_connect_flags & OBD_CONNECT_GRANT)
- data->ocd_grant = ofd_grant_connect(env, exp, data->ocd_grant,
- new_connection);
+ if (OCD_HAS_FLAG(data, GRANT_PARAM)) {
+ /* client is reporting its page size, for future use */
+ exp->exp_filter_data.fed_pagebits = data->ocd_grant_blkbits;
+ data->ocd_grant_blkbits = ofd->ofd_blockbits;
+ /* ddp_inodespace may not be power-of-two value, eg. for ldiskfs
+ * it's LDISKFS_DIR_REC_LEN(20) = 28. */
+ data->ocd_grant_inobits =
+ fls(ofd->ofd_dt_conf.ddp_inodespace - 1);
+ /* ocd_grant_tax_kb is in 1K byte blocks */
+ data->ocd_grant_tax_kb = ofd->ofd_dt_conf.ddp_extent_tax >> 10;
+ data->ocd_grant_max_blks = ofd->ofd_dt_conf.ddp_max_extent_blks;
+ }
+
+ if (OCD_HAS_FLAG(data, GRANT)) {
+ /* Save connect_data we have so far because ofd_grant_connect()
+ * uses it to calculate grant. */
+ exp->exp_connect_data = *data;
+ ofd_grant_connect(env, exp, data, new_connection);
+ }
if (data->ocd_connect_flags & OBD_CONNECT_INDEX) {
struct lr_server_data *lsd = &ofd->ofd_lut.lut_lsd;
tgt_server_data_update(env, &ofd->ofd_lut, 0);
}
}
- if (OBD_FAIL_CHECK(OBD_FAIL_OST_BRW_SIZE)) {
- data->ocd_brw_size = 65536;
- } else if (data->ocd_connect_flags & OBD_CONNECT_BRW_SIZE) {
- data->ocd_brw_size = min(data->ocd_brw_size,
- (__u32)DT_MAX_BRW_SIZE);
- if (data->ocd_brw_size == 0) {
- CERROR("%s: cli %s/%p ocd_connect_flags: "LPX64
- " ocd_version: %x ocd_grant: %d ocd_index: %u "
- "ocd_brw_size is unexpectedly zero, "
- "network data corruption?"
- "Refusing connection of this client\n",
- exp->exp_obd->obd_name,
- exp->exp_client_uuid.uuid,
- exp, data->ocd_connect_flags, data->ocd_version,
- data->ocd_grant, data->ocd_index);
- RETURN(-EPROTO);
- }
- }
if (data->ocd_connect_flags & OBD_CONNECT_CKSUM) {
__u32 cksum_types = data->ocd_cksum_types;
ofd_grant_discard(exp);
ofd_fmd_cleanup(exp);
- if (exp_connect_flags(exp) & OBD_CONNECT_GRANT_SHRINK) {
- if (ofd->ofd_tot_granted_clients > 0)
- ofd->ofd_tot_granted_clients --;
- }
+ if (exp_connect_flags(exp) & OBD_CONNECT_GRANT)
+ ofd->ofd_tot_granted_clients--;
if (!(exp->exp_flags & OBD_OPT_FORCE))
ofd_grant_sanity_check(exp->exp_obd, __FUNCTION__);
int ofd_postrecov(const struct lu_env *env, struct ofd_device *ofd)
{
struct lu_device *ldev = &ofd->ofd_dt_dev.dd_lu_dev;
- struct lfsck_start_param lsp;
int rc;
CDEBUG(D_HA, "%s: recovery is over\n", ofd_name(ofd));
- lsp.lsp_start = NULL;
- lsp.lsp_index_valid = 0;
- rc = lfsck_start(env, ofd->ofd_osd, &lsp);
- if (rc != 0 && rc != -EALREADY)
- CWARN("%s: auto trigger paused LFSCK failed: rc = %d\n",
- ofd_name(ofd), rc);
+ if (!ofd->ofd_skip_lfsck) {
+ struct lfsck_start_param lsp;
+
+ lsp.lsp_start = NULL;
+ lsp.lsp_index_valid = 0;
+ rc = lfsck_start(env, ofd->ofd_osd, &lsp);
+ if (rc != 0 && rc != -EALREADY)
+ CWARN("%s: auto trigger paused LFSCK failed: rc = %d\n",
+ ofd_name(ofd), rc);
+ }
return ldev->ld_ops->ldo_recovery_complete(env, ldev);
}
if (ofd->ofd_raid_degraded)
osfs->os_state |= OS_STATE_DEGRADED;
- if (obd->obd_self_export != exp && ofd_grant_compat(exp, ofd)) {
+ if (obd->obd_self_export != exp && !ofd_grant_param_supp(exp) &&
+ ofd->ofd_blockbits > COMPAT_BSIZE_SHIFT) {
/* clients which don't support OBD_CONNECT_GRANT_PARAM
* should not see a block size > page size, otherwise
* cl_lost_grant goes mad. Therefore, we emulate a 4KB (=2^12)
* \retval negative value on error
*/
static int ofd_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
- void *karg, void *uarg)
+ void *karg, void __user *uarg)
{
struct lu_env env;
struct ofd_device *ofd = ofd_exp(exp);
switch (cmd) {
case OBD_IOC_ABORT_RECOVERY:
CERROR("%s: aborting recovery\n", obd->obd_name);
- obd->obd_force_abort_recovery = 1;
+ obd->obd_abort_recovery = 1;
target_stop_recovery_thread(obd);
break;
case OBD_IOC_SYNC: