* GPL HEADER END
*/
/*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2013, 2016, Intel Corporation.
*/
/*
* lustre/target/tgt_handler.c
#include <obd.h>
#include <obd_class.h>
#include <obd_cksum.h>
-#include <md_object.h>
#include <lustre_lfsck.h>
#include <lustre_nodemap.h>
if (req_can_reconstruct(req, NULL)) {
if (!(lustre_msg_get_flags(req->rq_reqmsg) &
(MSG_RESENT | MSG_REPLAY))) {
- DEBUG_REQ(D_WARNING, req, "rq_xid "LPU64" matches "
+ DEBUG_REQ(D_WARNING, req, "rq_xid %llu matches "
"saved xid, expected REPLAY or RESENT flag "
"(%x)", req->rq_xid,
lustre_msg_get_flags(req->rq_reqmsg));
return rc;
}
-int tgt_adapt_sptlrpc_conf(struct lu_target *tgt, int initial)
+int tgt_adapt_sptlrpc_conf(struct lu_target *tgt)
{
struct sptlrpc_rule_set tmp_rset;
int rc;
}
sptlrpc_rule_set_init(&tmp_rset);
- rc = sptlrpc_conf_target_get_rules(tgt->lut_obd, &tmp_rset, initial);
+ rc = sptlrpc_conf_target_get_rules(tgt->lut_obd, &tmp_rset);
if (rc) {
CERROR("%s: failed get sptlrpc rules: rc = %d\n",
tgt_name(tgt), rc);
RETURN(-ENOMEM);
if (!(exp_connect_flags(exp) & OBD_CONNECT_BRW_SIZE))
- /* old client requires reply size in it's PAGE_CACHE_SIZE,
+ /* old client requires reply size in it's PAGE_SIZE,
* which is rdpg->rp_count */
nob = rdpg->rp_count;
for (i = 0, tmpcount = nob; i < rdpg->rp_npages && tmpcount > 0;
i++, tmpcount -= tmpsize) {
- tmpsize = min_t(int, tmpcount, PAGE_CACHE_SIZE);
+ tmpsize = min_t(int, tmpcount, PAGE_SIZE);
desc->bd_frag_ops->add_kiov_frag(desc, rdpg->rp_pages[i], 0,
tmpsize);
}
GOTO(out, rc = -EFAULT);
rdpg->rp_count = min_t(unsigned int, req_ii->ii_count << LU_PAGE_SHIFT,
exp_max_brw_size(tsi->tsi_exp));
- rdpg->rp_npages = (rdpg->rp_count + PAGE_CACHE_SIZE -1) >> PAGE_CACHE_SHIFT;
+ rdpg->rp_npages = (rdpg->rp_count + PAGE_SIZE - 1) >> PAGE_SHIFT;
/* allocate pages to store the containers */
OBD_ALLOC(rdpg->rp_pages, rdpg->rp_npages * sizeof(rdpg->rp_pages[0]));
if (rdpg->rp_pages == NULL)
GOTO(out, rc = -ENOMEM);
for (i = 0; i < rdpg->rp_npages; i++) {
- rdpg->rp_pages[i] = alloc_page(GFP_IOFS);
+ rdpg->rp_pages[i] = alloc_page(GFP_NOFS);
if (rdpg->rp_pages[i] == NULL)
GOTO(out, rc = -ENOMEM);
}
rc = tgt_sync(&env, tgt, obj, start, end);
if (rc < 0) {
- CERROR("%s: syncing "DFID" ("LPU64"-"LPU64") on lock "
+ CERROR("%s: syncing "DFID" (%llu-%llu) on lock "
"cancel: rc = %d\n",
tgt_name(tgt), PFID(&fid),
lock->l_policy_data.l_extent.start,
}
err_put:
if (obj != NULL)
- lu_object_put(&env, &obj->do_lu);
+ dt_object_put(&env, obj);
err_env:
lu_env_fini(&env);
}
};
EXPORT_SYMBOL(tgt_sec_ctx_handlers);
+int (*tgt_lfsck_in_notify_local)(const struct lu_env *env,
+ struct dt_device *key,
+ struct lfsck_req_local *lrl,
+ struct thandle *th) = NULL;
+
+void tgt_register_lfsck_in_notify_local(int (*notify)(const struct lu_env *,
+ struct dt_device *,
+ struct lfsck_req_local *,
+ struct thandle *))
+{
+ tgt_lfsck_in_notify_local = notify;
+}
+EXPORT_SYMBOL(tgt_register_lfsck_in_notify_local);
+
int (*tgt_lfsck_in_notify)(const struct lu_env *env,
struct dt_device *key,
- struct lfsck_request *lr,
- struct thandle *th) = NULL;
+ struct lfsck_request *lr) = NULL;
void tgt_register_lfsck_in_notify(int (*notify)(const struct lu_env *,
struct dt_device *,
- struct lfsck_request *,
- struct thandle *))
+ struct lfsck_request *))
{
tgt_lfsck_in_notify = notify;
}
if (lr == NULL)
RETURN(-EPROTO);
- rc = tgt_lfsck_in_notify(env, key, lr, NULL);
+ rc = tgt_lfsck_in_notify(env, key, lr);
RETURN(rc);
}
LASSERT(mode == LCK_PR || mode == LCK_PW);
LASSERT(!lustre_handle_is_used(lh));
+ if (ns->ns_obd->obd_recovering)
+ RETURN(0);
+
if (nrbufs == 0 || !(nb[0].rnb_flags & OBD_BRW_SRVLOCK))
RETURN(0);
}
LCONSOLE_ERROR_MSG(0x168, "BAD WRITE CHECKSUM: %s from %s%s%s inode "
- DFID" object "DOSTID" extent ["LPU64"-"LPU64
+ DFID" object "DOSTID" extent [%llu-%llu"
"]: client csum %x, server csum %x\n",
exp->exp_obd->obd_name, libcfs_id2str(req->rq_peer),
via, router,
cksum_type_t cksum_type = OBD_CKSUM_CRC32;
bool no_reply = false, mmap;
struct tgt_thread_big_cache *tbc = req->rq_svc_thread->t_data;
+ bool wait_sync = false;
ENTRY;
* has timed out the request already */
no_reply = true;
+ for (i = 0; i < niocount; i++) {
+ if (!(local_nb[i].lnb_flags & OBD_BRW_ASYNC)) {
+ wait_sync = true;
+ break;
+ }
+ }
/*
* Disable sending mtime back to the client. If the client locked the
* whole object, then it has already updated the mtime on its side,
if (desc)
ptlrpc_free_bulk(desc);
out:
- if (no_reply) {
+ if (unlikely(no_reply || (exp->exp_obd->obd_no_transno && wait_sync))) {
req->rq_no_reply = 1;
/* reply out callback would free */
ptlrpc_req_drop_rs(req);
- LCONSOLE_WARN("%s: Bulk IO write error with %s (at %s), "
- "client will retry: rc %d\n",
- exp->exp_obd->obd_name,
- obd_uuid2str(&exp->exp_client_uuid),
- obd_export_nid2str(exp), rc);
+ if (!exp->exp_obd->obd_no_transno)
+ LCONSOLE_WARN("%s: Bulk IO write error with %s (at %s),"
+ " client will retry: rc = %d\n",
+ exp->exp_obd->obd_name,
+ obd_uuid2str(&exp->exp_client_uuid),
+ obd_export_nid2str(exp), rc);
}
memory_pressure_clr();
RETURN(rc);