From: green Date: Tue, 6 Dec 2005 23:05:07 +0000 (+0000) Subject: b=9879 X-Git-Tag: v1_7_100~1^103~4^2~197 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7e8713bb62cde3cad809fce80e0b5002c9bc3332;p=fs%2Flustre-release.git b=9879 r=adilger Test that we do not receive any plain lock requests from ibits-aware clients. Test that client and server have intersecting lock bits, and if not - server drops IBITS compat flag. (if the flag is set and intersecting list of bits is zero on client - just error message is issued). We now also check that we do not return IBITS lock with sync callback to liblustre clients. --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 80d55f0..81d8602 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -715,6 +715,13 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req, "client?\n"); GOTO(out, rc = -EPROTO); } + if (req->rq_export->exp_connect_flags & OBD_CONNECT_IBITS && + dlm_req->lock_desc.l_resource.lr_type == LDLM_PLAIN) { + DEBUG_REQ(D_ERROR, req, "Plain lock request from ibita-aware " + "client?\n"); + GOTO(out, rc = -EPROTO); + } + /* INODEBITS_INTEROP: Perform conversion from plain lock to * inodebits lock if client does not support them. @@ -817,7 +824,8 @@ existing_lock: else if (lock->l_granted_mode == lock->l_req_mode) ldlm_add_waiting_lock(lock); } - if ((dlm_req->lock_desc.l_resource.lr_type == LDLM_PLAIN) && + if ((dlm_req->lock_desc.l_resource.lr_type == LDLM_PLAIN || + dlm_req->lock_desc.l_resource.lr_type == LDLM_IBITS) && req->rq_export->exp_libclient) { if (!(lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK) || !(dlm_rep->lock_flags & LDLM_FL_CANCEL_ON_BLOCK)) { diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index f4cded0..d6ad415f 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -256,6 +256,13 @@ static int mds_connect_internal(struct obd_export *exp, struct obd_device *obd, data->ocd_connect_flags &= MDS_CONNECT_SUPPORTED; data->ocd_ibits_known &= MDS_INODELOCK_FULL; + /* If no known bits (which should not happen, probably, + as everybody should support LOOKUP and UPDATE bits at least) + revert to compat mode with plain locks. */ + if (!data->ocd_ibits_known && + data->ocd_connect_flags & OBD_CONNECT_IBITS) + data->ocd_connect_flags &= ~OBD_CONNECT_IBITS; + if (!obd->u.mds.mds_fl_acl) data->ocd_connect_flags &= ~OBD_CONNECT_ACL; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 1213342..4ab7435 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -577,6 +577,11 @@ finish: ocd->ocd_connect_flags); imp->imp_connect_data = *ocd; + if (!ocd->ocd_ibits_known && + ocd->ocd_connect_flags & OBD_CONNECT_IBITS) + CERROR("Inodebits aware server returned zero compatible" + " bits?\n"); + exp = class_conn2export(&imp->imp_dlm_handle); LASSERT(exp); exp->exp_connect_flags = ocd->ocd_connect_flags;