/** Transient page, the transient cl_page is used to bind a cl_page
* to vmpage which is not belonging to the same object of cl_page.
- * it is used in DirectIO, lockless IO and liblustre. */
+ * it is used in DirectIO and lockless IO. */
CPT_TRANSIENT,
};
* protects exp_flags, exp_outstanding_replies and the change
* of exp_imp_reverse
*/
- spinlock_t exp_lock;
+ spinlock_t exp_lock;
/** Compatibility flags for this export are embedded into
* exp_connect_data */
- struct obd_connect_data exp_connect_data;
- enum obd_option exp_flags;
- unsigned long exp_failed:1,
- exp_in_recovery:1,
- exp_disconnected:1,
- exp_connecting:1,
- /** VBR: export missed recovery */
- exp_delayed:1,
- /** VBR: failed version checking */
- exp_vbr_failed:1,
- exp_req_replay_needed:1,
- exp_lock_replay_needed:1,
- exp_need_sync:1,
- exp_flvr_changed:1,
- exp_flvr_adapt:1,
- exp_libclient:1, /* liblustre client? */
- /* if to swap nidtbl entries for 2.2 clients.
- * Only used by the MGS to fix LU-1644. */
- exp_need_mne_swab:1,
- /* The export already got final replay ping
- * request. */
- exp_replay_done:1;
- /* also protected by exp_lock */
- enum lustre_sec_part exp_sp_peer;
- struct sptlrpc_flavor exp_flvr; /* current */
- struct sptlrpc_flavor exp_flvr_old[2]; /* about-to-expire */
- time64_t exp_flvr_expire[2]; /* seconds */
-
- /** protects exp_hp_rpcs */
+ struct obd_connect_data exp_connect_data;
+ enum obd_option exp_flags;
+ unsigned long exp_failed:1,
+ exp_in_recovery:1,
+ exp_disconnected:1,
+ exp_connecting:1,
+ /** VBR: export missed recovery */
+ exp_delayed:1,
+ /** VBR: failed version checking */
+ exp_vbr_failed:1,
+ exp_req_replay_needed:1,
+ exp_lock_replay_needed:1,
+ exp_need_sync:1,
+ exp_flvr_changed:1,
+ exp_flvr_adapt:1,
+ /* if to swap nidtbl entries for 2.2 clients.
+ * Only used by the MGS to fix LU-1644. */
+ exp_need_mne_swab:1,
+ /* The export already got final replay ping
+ * request. */
+ exp_replay_done:1;
+ /* also protected by exp_lock */
+ enum lustre_sec_part exp_sp_peer;
+ struct sptlrpc_flavor exp_flvr; /* current */
+ struct sptlrpc_flavor exp_flvr_old[2]; /* about-to-expire */
+ time64_t exp_flvr_expire[2]; /* seconds */
+
+ /** protects exp_hp_rpcs */
spinlock_t exp_rpc_lock;
struct list_head exp_hp_rpcs; /* (potential) HP RPCs */
struct list_head exp_reg_rpcs; /* RPC being handled */
int ptlrpc_start_threads(struct ptlrpc_service *svc);
int ptlrpc_unregister_service(struct ptlrpc_service *service);
-int liblustre_check_services(void *arg);
-void ptlrpc_daemonize(char *name);
int ptlrpc_service_health_check(struct ptlrpc_service *);
void ptlrpc_server_drop_request(struct ptlrpc_request *req);
void ptlrpc_request_change_export(struct ptlrpc_request *req,
/*
* Data structure used to pass obd_notify()-event to non-obd listeners (llite
- * and liblustre being main examples).
+ * being main example).
*/
struct obd_notify_upcall {
int (*onu_upcall)(struct obd_device *host, struct obd_device *watched,
#define MSG_CONNECT_RECOVERING 0x00000001
#define MSG_CONNECT_RECONNECT 0x00000002
#define MSG_CONNECT_REPLAYABLE 0x00000004
-//#define MSG_CONNECT_PEER 0x8
+/* #define MSG_CONNECT_PEER 0x00000008 removed 1.5 */
#define MSG_CONNECT_LIBCLIENT 0x00000010
#define MSG_CONNECT_INITIAL 0x00000020
#define MSG_CONNECT_ASYNC 0x00000040
#define LUSTRE_VERSION_CODE \
OBD_OCD_VERSION(LUSTRE_MAJOR, LUSTRE_MINOR, LUSTRE_PATCH, LUSTRE_FIX)
-/* liblustre clients are only allowed to connect if their LUSTRE_FIX mismatches
- * by this amount (set in lustre/autoconf/lustre-version.ac). */
-#define LUSTRE_VERSION_ALLOWED_OFFSET OBD_OCD_VERSION(0, 0, 1, 32)
-
-#ifdef __KERNEL__
/* If lustre version of client and servers it connects to differs by more
* than this amount, client would issue a warning.
* (set in lustre/autoconf/lustre-version.ac) */
#define LUSTRE_VERSION_OFFSET_WARN OBD_OCD_VERSION(0, 4, 50, 0)
-#endif
#endif
*/
if (!(data->ocd_connect_flags & OBD_CONNECT_FULL20))
GOTO(out, rc = -EPROTO);
-#endif
+ /* Don't allow liblustre clients to connect.
+ * - testing was disabled in v2_2_50_0-61-g6a75d65
+ * - building was disabled in v2_5_58_0-28-g7277179
+ * - client code was deleted in v2_6_50_0-101-gcdfbc72,
+ * - clients were refused connect for version difference > 0.0.1.32 */
if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_LIBCLIENT) {
- if (data->ocd_version < LUSTRE_VERSION_CODE -
- LUSTRE_VERSION_ALLOWED_OFFSET ||
- data->ocd_version > LUSTRE_VERSION_CODE +
- LUSTRE_VERSION_ALLOWED_OFFSET) {
- DEBUG_REQ(D_WARNING, req, "Refusing %s (%d.%d.%d.%d) "
- "libclient connection attempt",
- data->ocd_version < LUSTRE_VERSION_CODE ?
- "old" : "new",
- OBD_OCD_VERSION_MAJOR(data->ocd_version),
- OBD_OCD_VERSION_MINOR(data->ocd_version),
- OBD_OCD_VERSION_PATCH(data->ocd_version),
- OBD_OCD_VERSION_FIX(data->ocd_version));
- data = req_capsule_server_sized_get(&req->rq_pill,
- &RMF_CONNECT_DATA,
- offsetof(typeof(*data), ocd_version) +
- sizeof(data->ocd_version));
- if (data) {
- data->ocd_connect_flags = OBD_CONNECT_VERSION;
- data->ocd_version = LUSTRE_VERSION_CODE;
- }
- GOTO(out, rc = -EPROTO);
- }
+ DEBUG_REQ(D_WARNING, req, "Refusing libclient connection");
+ GOTO(out, rc = -EPROTO);
}
+#endif
/* Note: lw_client is needed in MDS-MDS failover during update log
* processing, so we needs to allow lw_client to be connected at
spin_unlock(&export->exp_lock);
CDEBUG(D_RPCTRACE, "%s: %s already connected at greater "
"or equal conn_cnt: %d >= %d\n",
- cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
- export->exp_conn_cnt,
- lustre_msg_get_conn_cnt(req->rq_reqmsg));
+ cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
+ export->exp_conn_cnt,
+ lustre_msg_get_conn_cnt(req->rq_reqmsg));
- GOTO(out, rc = -EALREADY);
- }
- LASSERT(lustre_msg_get_conn_cnt(req->rq_reqmsg) > 0);
- export->exp_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);
-
- /* Don't evict liblustre clients for not pinging. */
- if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_LIBCLIENT) {
- export->exp_libclient = 1;
- spin_unlock(&export->exp_lock);
-
- spin_lock(&target->obd_dev_lock);
- list_del_init(&export->exp_obd_chain_timed);
- spin_unlock(&target->obd_dev_lock);
- } else {
- spin_unlock(&export->exp_lock);
+ GOTO(out, rc = -EALREADY);
}
+ LASSERT(lustre_msg_get_conn_cnt(req->rq_reqmsg) > 0);
+ export->exp_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);
+ spin_unlock(&export->exp_lock);
- if (export->exp_connection != NULL) {
+ if (export->exp_connection != NULL) {
/* Check to see if connection came from another NID. */
- if ((export->exp_connection->c_peer.nid != req->rq_peer.nid) &&
+ if ((export->exp_connection->c_peer.nid != req->rq_peer.nid) &&
!hlist_unhashed(&export->exp_nid_hash))
- cfs_hash_del(export->exp_obd->obd_nid_hash,
- &export->exp_connection->c_peer.nid,
- &export->exp_nid_hash);
+ cfs_hash_del(export->exp_obd->obd_nid_hash,
+ &export->exp_connection->c_peer.nid,
+ &export->exp_nid_hash);
- ptlrpc_connection_put(export->exp_connection);
- }
+ ptlrpc_connection_put(export->exp_connection);
+ }
export->exp_connection = ptlrpc_connection_get(req->rq_peer,
req->rq_self,
struct lnet_process_id peer = req->rq_import->imp_connection->c_peer;
if (!req->rq_replied || (rc && rc != -EINVAL)) {
- if (lock->l_export && lock->l_export->exp_libclient) {
- LDLM_DEBUG(lock,
- "%s AST (req@%p x%llu) to liblustre client (nid %s) timeout, just cancelling lock",
- ast_type, req, req->rq_xid,
- libcfs_nid2str(peer.nid));
- ldlm_lock_cancel(lock);
- rc = -ERESTART;
- } else if (ldlm_is_cancel(lock)) {
+ if (ldlm_is_cancel(lock)) {
LDLM_DEBUG(lock,
"%s AST (req@%p x%llu) timeout from nid %s, but cancel was received (AST reply lost?)",
ast_type, req, req->rq_xid,
ldlm_add_waiting_lock(lock);
}
}
- /* Make sure we never ever grant usual metadata locks to liblustre
- clients */
- 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 (unlikely(!ldlm_is_cancel_on_block(lock) ||
- !(dlm_rep->lock_flags & LDLM_FL_CANCEL_ON_BLOCK))){
- CERROR("Granting sync lock to libclient. "
- "req fl %d, rep fl %d, lock fl %#llx\n",
- dlm_req->lock_flags, dlm_rep->lock_flags,
- lock->l_flags);
- LDLM_ERROR(lock, "sync lock");
- if (dlm_req->lock_flags & LDLM_FL_HAS_INTENT) {
- struct ldlm_intent *it;
-
- it = req_capsule_client_get(&req->rq_pill,
- &RMF_LDLM_INTENT);
- if (it != NULL) {
- CERROR("This is intent %s (%llu)\n",
- ldlm_it2str(it->opc), it->opc);
- }
- }
- }
- }
-
- unlock_res_and_lock(lock);
+ unlock_res_and_lock(lock);
- EXIT;
+ EXIT;
out:
req->rq_status = rc ?: err; /* return either error - bug 11190 */
if (!req->rq_packed_final) {
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * glimpse code shared between vvp and liblustre (and other Lustre clients in
- * the future).
+ * glimpse code used by vvp (and other Lustre clients in the future).
*
* Author: Nikita Danilov <nikita.danilov@sun.com>
* Author: Oleg Drokin <oleg.drokin@sun.com>
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
- * cl code shared between vvp and liblustre (and other Lustre clients in the
- * future).
+ * cl code used by vvp (and other Lustre clients in the future).
*
*/
#define DEBUG_SUBSYSTEM S_LLITE
};
#ifdef CONFIG_PROC_FS
-/* ifdef needed for liblustre support */
/*
* pool /proc seq_file methods
*/
result = mdt_cross_open(info, rr->rr_fid2, rr->rr_fid1,
ldlm_rep, create_flags);
GOTO(out, result);
- } else if (req_is_replay(req) ||
- (req->rq_export->exp_libclient && create_flags & MDS_OPEN_HAS_EA)) {
- /* This is a replay request or from liblustre with ea. */
+ } else if (req_is_replay(req)) {
result = mdt_open_by_fid(info, ldlm_rep);
- if (result != -ENOENT) {
- if (req->rq_export->exp_libclient &&
- create_flags & MDS_OPEN_HAS_EA)
- GOTO(out, result = 0);
+ if (result != -ENOENT)
GOTO(out, result);
- }
+
/* We didn't find the correct object, so we need to re-create it
* via a regular replay. */
if (!(create_flags & MDS_OPEN_CREAT)) {
/**
* The most efficient way is to store cl_env pointer in task specific
- * structures. On Linux, it wont' be easy to use task_struct->journal_info
- * because Lustre code may call into other fs which has certain assumptions
- * about journal_info. Currently following fields in task_struct are identified
- * can be used for this purpose:
- * - cl_env: for liblustre.
- * - tux_info: ony on RedHat kernel.
- * - ...
+ * structures. On Linux, it isn't easy to use task_struct->journal_info
+ * because Lustre code may call into other fs during memory reclaim, which
+ * has certain assumptions about journal_info. There are not currently any
+ * fields in task_struct that can be used for this purpose.
* \note As long as we use task_struct to store cl_env, we assume that once
* called into Lustre, we'll never call into the other part of the kernel
* which will use those fields in task_struct without explicitly exiting
* Lustre.
*
- * If there's no space in task_struct is available, hash will be used.
+ * Since there's no space in task_struct is available, hash will be used.
* bz20044, bz22683.
*/
/* Find the 'victim' lock from this interval */
list_for_each_entry(lck, &node->li_group, l_sl_policy) {
-
victim_lock = LDLM_LOCK_GET(lck);
/* the same policy group - every lock has the
spin_unlock(&imp->imp_lock);
-
if (!warned && (ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
(ocd->ocd_version > LUSTRE_VERSION_CODE +
LUSTRE_VERSION_OFFSET_WARN ||
const char *older = "older than client. "
"Consider upgrading server";
const char *newer = "newer than client. "
- "Consider recompiling application";
+ "Consider upgrading client";
LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) "
"is much %s (%s)\n",
if (request->rq_repmsg == NULL)
RETURN(-EPROTO);
- ocd = req_capsule_server_get(&request->rq_pill,
- &RMF_CONNECT_DATA);
- if (ocd &&
- (ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
- (ocd->ocd_version != LUSTRE_VERSION_CODE)) {
- /* Actually servers are only supposed to refuse
- connection from liblustre clients, so we should
- never see this from VFS context */
+ ocd = req_capsule_server_get(&request->rq_pill,
+ &RMF_CONNECT_DATA);
+ /* Servers are not supposed to refuse connections from
+ * clients based on version, only connection feature
+ * flags. We should never see this from llite, but it
+ * may be useful for debugging in the future. */
+ if (ocd &&
+ (ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
+ (ocd->ocd_version != LUSTRE_VERSION_CODE)) {
LCONSOLE_ERROR_MSG(0x16a, "Server %s version "
"(%d.%d.%d.%d)"
" refused connection from this client "
}
run_test 28 "read/write/truncate file with lost stripes"
-test_29() { # bug 10999
- touch $DIR1/$tfile
- #define OBD_FAIL_LDLM_GLIMPSE 0x30f
- lctl set_param fail_loc=0x8000030f
- ls -l $DIR2/$tfile &
- usleep 500
- dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1
- wait
-}
-#bug 11549 - permanently turn test off in b1_5
-run_test 29 "lock put race between glimpse and enqueue ========="
-
-test_30() { #bug #11110, LU-2523
+test_30() { #b=11110, LU-2523
test_mkdir $DIR1/$tdir
cp -f /bin/bash $DIR1/$tdir/bash
/bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
wait
true
}
-
run_test 30 "recreate file race"
test_31a() {