1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * linux/mds/mds_reint.c
6 * Lustre Metadata Server (mds) reintegration routines
8 * Copyright (C) 2002 Cluster File Systems, Inc.
9 * author: Peter Braam <braam@clusterfs.com>
11 * This code is issued under the GNU General Public License.
12 * See the file COPYING in this distribution
16 // XXX - add transaction sequence numbers
19 #define DEBUG_SUBSYSTEM S_MDS
21 #include <linux/obd_support.h>
22 #include <linux/obd_class.h>
23 #include <linux/obd.h>
24 #include <linux/lustre_lib.h>
25 #include <linux/lustre_idl.h>
26 #include <linux/lustre_mds.h>
27 #include <linux/lustre_dlm.h>
28 #include <linux/obd_class.h>
30 extern inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req);
32 struct mds_client_info *mds_uuid_to_mci(struct mds_obd *mds, __u8 *uuid)
39 list_for_each(p, &mds->mds_client_info) {
40 struct mds_client_info *mci;
42 mci = list_entry(p, struct mds_client_info, mci_list);
43 CDEBUG(D_INFO, "checking client UUID '%s'\n",
44 mci->mci_mcd->mcd_uuid);
45 if (!strncmp(mci->mci_mcd->mcd_uuid, uuid,
46 sizeof(mci->mci_mcd->mcd_uuid)))
49 CDEBUG(D_INFO, "no mds client info found for UUID '%s'\n", uuid);
53 /* Assumes caller has already pushed us into the kernel context. */
54 int mds_update_last_rcvd(struct mds_obd *mds, void *handle,
55 struct ptlrpc_request *req)
57 /* get from req->rq_connection-> or req->rq_client */
58 struct mds_client_info *mci;
62 mci = mds_uuid_to_mci(mds, req->rq_connection->c_remote_uuid);
64 CERROR("unable to locate MDS client data for UUID '%s'\n",
65 ptlrpc_req_to_uuid(req));
66 /* This will be a real error once everything is working */
71 off = MDS_LR_CLIENT + mci->mci_off * MDS_LR_SIZE;
73 ++mds->mds_last_rcvd; /* lock this, or make it an LDLM function? */
74 req->rq_repmsg->transno = HTON__u64(mds->mds_last_rcvd);
75 mci->mci_mcd->mcd_last_rcvd = cpu_to_le64(mds->mds_last_rcvd);
76 mci->mci_mcd->mcd_mount_count = cpu_to_le64(mds->mds_mount_count);
77 mci->mci_mcd->mcd_last_xid = cpu_to_le64(req->rq_xid);
79 mds_fs_set_last_rcvd(mds, handle);
80 rc = lustre_fwrite(mds->mds_rcvd_filp, (char *)mci->mci_mcd,
81 sizeof(*mci->mci_mcd), &off);
82 CDEBUG(D_INODE, "wrote trans #%Ld for client '%s' at #%d: rc = %d\n",
83 mds->mds_last_rcvd, mci->mci_mcd->mcd_uuid, mci->mci_off, rc);
84 // store new value and last committed value in req struct
86 if (rc == sizeof(*mci->mci_mcd))
89 CERROR("error writing to last_rcvd file: rc = %d\n", rc);
97 /* In the write-back case, the client holds a lock on a subtree.
98 * In the intent case, the client holds a lock on the child inode.
99 * In the pathname case, the client (may) hold a lock on the child inode. */
100 static int mds_reint_setattr(struct mds_update_record *rec, int offset,
101 struct ptlrpc_request *req)
103 struct mds_obd *mds = mds_req2mds(req);
106 struct lustre_handle child_lockh;
109 if (req->rq_reqmsg->bufcount > offset + 1) {
111 struct lustre_handle dir_lockh;
115 /* a name was supplied by the client; fid1 is the directory */
116 dir = mds_fid2locked_dentry(mds, rec->ur_fid1, NULL, LCK_PR,
118 if (!dir || IS_ERR(dir)) {
121 GOTO(out_setattr, rc = -ESTALE);
124 name = lustre_msg_buf(req->rq_reqmsg, offset + 1);
125 namelen = req->rq_reqmsg->buflens[offset + 1] - 1;
126 de = mds_name2locked_dentry(mds, dir, NULL, name, namelen,
127 0, &child_lockh, LCK_PR);
129 if (!de || IS_ERR(de)) {
131 GOTO(out_setattr_de, rc = -ESTALE);
134 de = mds_fid2dentry(mds, rec->ur_fid1, NULL);
135 if (!de || IS_ERR(de)) {
137 GOTO(out_setattr_de, rc = -ESTALE);
140 CDEBUG(D_INODE, "ino %ld\n", de->d_inode->i_ino);
142 OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_SETATTR_WRITE,
143 de->d_inode->i_sb->s_dev);
146 handle = mds_fs_start(mds, de->d_inode, MDS_FSOP_SETATTR);
148 GOTO(out_unlock, rc = PTR_ERR(handle));
149 rc = mds_fs_setattr(mds, de, handle, &rec->ur_iattr);
152 rc = mds_update_last_rcvd(mds, handle, req);
154 err = mds_fs_commit(mds, de->d_inode, handle);
156 CERROR("error on commit: err = %d\n", err);
171 static int mds_reint_recreate(struct mds_update_record *rec, int offset,
172 struct ptlrpc_request *req)
174 struct dentry *de = NULL;
175 struct mds_obd *mds = mds_req2mds(req);
176 struct dentry *dchild = NULL;
181 de = mds_fid2dentry(mds, rec->ur_fid1, NULL);
182 if (IS_ERR(de) || OBD_FAIL_CHECK(OBD_FAIL_MDS_REINT_CREATE)) {
184 GOTO(out_create_de, rc = -ESTALE);
187 CDEBUG(D_INODE, "parent ino %ld\n", dir->i_ino);
190 dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
191 if (IS_ERR(dchild)) {
192 CERROR("child lookup error %ld\n", PTR_ERR(dchild));
195 GOTO(out_create_dchild, rc = -ESTALE);
198 if (dchild->d_inode) {
199 struct mds_body *body;
201 body = lustre_msg_buf(req->rq_repmsg, 0);
202 body->ino = dchild->d_inode->i_ino;
203 body->generation = dchild->d_inode->i_generation;
205 CERROR("child doesn't exist (dir %ld, name %s)\n",
206 dir->i_ino, rec->ur_name);
220 static int mds_reint_create(struct mds_update_record *rec, int offset,
221 struct ptlrpc_request *req)
223 struct dentry *de = NULL;
224 struct mds_obd *mds = mds_req2mds(req);
225 struct dentry *dchild = NULL;
228 struct lustre_handle lockh;
229 int rc = 0, err, flags, lock_mode, type = rec->ur_mode & S_IFMT;
230 __u64 res_id[3] = {0,0,0};
233 /* requests were at offset 2, replies go back at 1 */
237 if (strcmp(req->rq_export->exp_obd->obd_type->typ_name, "mds") != 0)
240 de = mds_fid2dentry(mds, rec->ur_fid1, NULL);
241 if (IS_ERR(de) || OBD_FAIL_CHECK(OBD_FAIL_MDS_REINT_CREATE)) {
243 GOTO(out_create_de, rc = -ESTALE);
246 CDEBUG(D_INODE, "parent ino %ld name %s mode %o\n",
247 dir->i_ino, rec->ur_name, rec->ur_mode);
249 lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_CW : LCK_PW;
250 res_id[0] = dir->i_ino;
252 rc = ldlm_lock_match(mds->mds_local_namespace, res_id, LDLM_PLAIN,
253 NULL, 0, lock_mode, &lockh);
255 LDLM_DEBUG_NOLOCK("enqueue res %Lu", res_id[0]);
256 rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
257 (struct lustre_handle *)&mds->mds_connh,
258 NULL, mds->mds_local_namespace, NULL,
259 res_id, LDLM_PLAIN, NULL, 0, lock_mode,
260 &flags, (void *)mds_lock_callback, NULL,
262 if (rc != ELDLM_OK) {
263 CERROR("lock enqueue: err: %d\n", rc);
264 GOTO(out_create_de, rc = -EIO);
267 ldlm_lock_dump((void *)(unsigned long)lockh.addr);
270 dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
271 if (IS_ERR(dchild)) {
272 CERROR("child lookup error %ld\n", PTR_ERR(dchild));
275 GOTO(out_create_dchild, rc = -ESTALE);
278 if (dchild->d_inode) {
279 struct mds_body *body;
280 struct inode *inode = dchild->d_inode;
281 struct lov_stripe_md *md;
282 CDEBUG(D_INODE, "child exists (dir %ld, name %s, ino %ld)\n",
283 dir->i_ino, rec->ur_name, dchild->d_inode->i_ino);
285 body = lustre_msg_buf(req->rq_repmsg, offset);
286 mds_pack_inode2fid(&body->fid1, inode);
287 mds_pack_inode2body(body, inode);
288 #warning FIXME: This ext3/N-specific code does not belong here
289 /* If i_file_acl is set, this inode has an EA */
290 if (S_ISREG(inode->i_mode) && inode->u.ext3_i.i_file_acl) {
291 md = lustre_msg_buf(req->rq_repmsg, offset + 1);
292 md->lmd_size = mds->mds_max_mdsize;
293 mds_fs_get_md(mds, inode, md);
295 /* now a normal case for intent locking */
296 GOTO(out_create_dchild, rc = -EEXIST);
299 OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_CREATE_WRITE, dir->i_sb->s_dev);
301 if (dir->i_mode & S_ISGID) {
302 rec->ur_gid = dir->i_gid;
303 if (S_ISDIR(rec->ur_mode))
304 rec->ur_mode |= S_ISGID;
309 handle = mds_fs_start(mds, dir, MDS_FSOP_CREATE);
311 GOTO(out_create_dchild, PTR_ERR(handle));
312 rc = vfs_create(dir, dchild, rec->ur_mode);
317 handle = mds_fs_start(mds, dir, MDS_FSOP_MKDIR);
319 GOTO(out_create_dchild, PTR_ERR(handle));
320 rc = vfs_mkdir(dir, dchild, rec->ur_mode);
325 handle = mds_fs_start(mds, dir, MDS_FSOP_SYMLINK);
327 GOTO(out_create_dchild, PTR_ERR(handle));
328 rc = vfs_symlink(dir, dchild, rec->ur_tgt);
336 int rdev = rec->ur_rdev;
337 handle = mds_fs_start(mds, dir, MDS_FSOP_MKNOD);
339 GOTO(out_create_dchild, PTR_ERR(handle));
340 rc = vfs_mknod(dir, dchild, rec->ur_mode, rdev);
345 CERROR("bad file type %d for create of %s\n",type,rec->ur_name);
346 GOTO(out_create_dchild, rc = -EINVAL);
350 CERROR("error during create: %d\n", rc);
353 GOTO(out_create_commit, rc);
356 struct inode *inode = dchild->d_inode;
357 struct mds_body *body;
359 CDEBUG(D_INODE, "created ino %ld\n", dchild->d_inode->i_ino);
360 if (!offset && type == S_IFREG) {
361 struct lov_stripe_md *md;
362 md = lustre_msg_buf(req->rq_reqmsg, 2);
363 rc = mds_fs_set_md(mds, inode, handle, md);
365 CERROR("error %d setting obdo for %ld\n",
367 GOTO(out_create_unlink, rc);
371 iattr.ia_atime = rec->ur_time;
372 iattr.ia_ctime = rec->ur_time;
373 iattr.ia_mtime = rec->ur_time;
374 iattr.ia_uid = rec->ur_uid;
375 iattr.ia_gid = rec->ur_gid;
376 iattr.ia_valid = ATTR_UID | ATTR_GID | ATTR_ATIME |
377 ATTR_MTIME | ATTR_CTIME;
379 rc = mds_fs_setattr(mds, dchild, handle, &iattr);
381 CERROR("error on setattr: rc = %d\n", rc);
382 /* XXX should we abort here in case of error? */
385 rc = mds_update_last_rcvd(mds, handle, req);
387 CERROR("error on update_last_rcvd: rc = %d\n", rc);
388 /* XXX should we abort here in case of error? */
391 body = lustre_msg_buf(req->rq_repmsg, offset);
392 body->ino = inode->i_ino;
393 body->generation = inode->i_generation;
397 err = mds_fs_commit(mds, dir, handle);
399 CERROR("error on commit: err = %d\n", err);
406 ldlm_lock_decref(&lockh, lock_mode);
413 /* Destroy the file we just created. This should not need extra
414 * journal credits, as we have already modified all of the blocks
415 * needed in order to create the file in the first place.
419 err = vfs_rmdir(dir, dchild);
421 CERROR("failed rmdir in error path: rc = %d\n", err);
424 err = vfs_unlink(dir, dchild);
426 CERROR("failed unlink in error path: rc = %d\n", err);
429 goto out_create_commit;
432 static int mds_reint_unlink(struct mds_update_record *rec, int offset,
433 struct ptlrpc_request *req)
435 struct dentry *de = NULL;
436 struct dentry *dchild = NULL;
437 struct mds_obd *mds = mds_req2mds(req);
440 struct inode *dir, *inode;
442 struct lustre_handle lockh, child_lockh;
448 /* a name was supplied by the client; fid1 is the directory */
449 lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_CW : LCK_PW;
450 de = mds_fid2locked_dentry(mds, rec->ur_fid1, NULL, lock_mode,
452 if (!de || IS_ERR(de)) {
457 name = lustre_msg_buf(req->rq_reqmsg, offset + 1);
458 namelen = req->rq_reqmsg->buflens[offset + 1] - 1;
459 dchild = mds_name2locked_dentry(mds, de, NULL, name, namelen,
460 LCK_EX, &child_lockh, lock_mode);
462 if (!dchild || IS_ERR(dchild)
463 || OBD_FAIL_CHECK(OBD_FAIL_MDS_REINT_UNLINK)) {
465 GOTO(out_unlink, rc = -ESTALE);
469 inode = dchild->d_inode;
470 CDEBUG(D_INODE, "parent ino %ld\n", dir->i_ino);
473 CDEBUG(D_INODE, "child doesn't exist (dir %ld, name %s\n",
474 dir->i_ino, rec->ur_name);
475 GOTO(out_unlink_dchild, rc = -ENOENT);
477 struct mds_body *body = lustre_msg_buf(req->rq_repmsg, 1);
478 mds_pack_inode2fid(&body->fid1, inode);
479 mds_pack_inode2body(body, inode);
482 OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_UNLINK_WRITE, dir->i_sb->s_dev);
484 switch (inode->i_mode & S_IFMT) {
486 handle = mds_fs_start(mds, dir, MDS_FSOP_RMDIR);
488 GOTO(out_unlink_cancel, rc = PTR_ERR(handle));
489 rc = vfs_rmdir(dir, dchild);
492 if (inode->u.ext3_i.i_file_acl && offset) {
493 struct lov_stripe_md *md;
494 md = lustre_msg_buf(req->rq_repmsg, 2);
495 rc = mds_fs_get_md(mds, inode, md);
497 CDEBUG(D_INFO, "No md for ino %ld err %d\n",
499 memset(md, 0, md->lmd_size);
503 handle = mds_fs_start(mds, dir, MDS_FSOP_UNLINK);
505 GOTO(out_unlink_cancel, rc = PTR_ERR(handle));
506 rc = vfs_unlink(dir, dchild);
511 rc = mds_update_last_rcvd(mds, handle, req);
512 err = mds_fs_commit(mds, dir, handle);
514 CERROR("error on commit: err = %d\n", err);
522 ldlm_lock_decref(&child_lockh, LCK_EX);
523 rc = ldlm_cli_cancel(&child_lockh);
525 CERROR("failed to cancel child inode lock ino\n");
530 ldlm_lock_decref(&lockh, lock_mode);
536 static int mds_reint_link(struct mds_update_record *rec, int offset,
537 struct ptlrpc_request *req)
539 struct dentry *de_src = NULL;
540 struct dentry *de_tgt_dir = NULL;
541 struct dentry *dchild = NULL;
542 struct mds_obd *mds = mds_req2mds(req);
548 de_src = mds_fid2dentry(mds, rec->ur_fid1, NULL);
549 if (IS_ERR(de_src) || OBD_FAIL_CHECK(OBD_FAIL_MDS_REINT_LINK)) {
550 GOTO(out_link, rc = -ESTALE);
553 de_tgt_dir = mds_fid2dentry(mds, rec->ur_fid2, NULL);
554 if (IS_ERR(de_tgt_dir)) {
555 GOTO(out_link_de_src, rc = -ESTALE);
558 down(&de_tgt_dir->d_inode->i_sem);
559 dchild = lookup_one_len(rec->ur_name, de_tgt_dir, rec->ur_namelen - 1);
560 if (IS_ERR(dchild)) {
561 CERROR("child lookup error %ld\n", PTR_ERR(dchild));
562 GOTO(out_link_de_tgt_dir, rc = -ESTALE);
565 if (dchild->d_inode) {
566 CERROR("child exists (dir %ld, name %s\n",
567 de_tgt_dir->d_inode->i_ino, rec->ur_name);
568 GOTO(out_link_dchild, rc = -EEXIST);
571 OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_LINK_WRITE,
572 de_src->d_inode->i_sb->s_dev);
574 handle = mds_fs_start(mds, de_tgt_dir->d_inode, MDS_FSOP_LINK);
576 GOTO(out_link_dchild, rc = PTR_ERR(handle));
578 rc = vfs_link(de_src, de_tgt_dir->d_inode, dchild);
581 rc = mds_update_last_rcvd(mds, handle, req);
583 err = mds_fs_commit(mds, de_tgt_dir->d_inode, handle);
585 CERROR("error on commit: err = %d\n", err);
594 up(&de_tgt_dir->d_inode->i_sem);
603 static int mds_reint_rename(struct mds_update_record *rec, int offset,
604 struct ptlrpc_request *req)
606 struct dentry *de_srcdir = NULL;
607 struct dentry *de_tgtdir = NULL;
608 struct dentry *de_old = NULL;
609 struct dentry *de_new = NULL;
610 struct mds_obd *mds = mds_req2mds(req);
611 struct lustre_handle tgtlockh, srclockh, oldhandle;
612 int flags, lock_mode, rc = 0, err;
614 __u64 res_id[3] = {0};
617 de_srcdir = mds_fid2dentry(mds, rec->ur_fid1, NULL);
618 if (IS_ERR(de_srcdir))
619 GOTO(out_rename, rc = -ESTALE);
621 lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_CW : LCK_PW;
622 res_id[0] = de_srcdir->d_inode->i_ino;
624 rc = ldlm_lock_match(mds->mds_local_namespace, res_id, LDLM_PLAIN,
625 NULL, 0, lock_mode, &srclockh);
627 LDLM_DEBUG_NOLOCK("enqueue res %Lu", res_id[0]);
628 rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
629 (struct lustre_handle *)&mds->mds_connh,
630 NULL, mds->mds_local_namespace, NULL,
631 res_id, LDLM_PLAIN, NULL, 0, lock_mode,
632 &flags, (void *)mds_lock_callback, NULL,
634 if (rc != ELDLM_OK) {
635 CERROR("lock enqueue: err: %d\n", rc);
636 GOTO(out_rename_srcput, rc = -EIO);
639 ldlm_lock_dump((void *)(unsigned long)srclockh.addr);
641 de_tgtdir = mds_fid2dentry(mds, rec->ur_fid2, NULL);
642 if (IS_ERR(de_tgtdir))
643 GOTO(out_rename_srcdir, rc = -ESTALE);
645 lock_mode = (req->rq_reqmsg->opc == MDS_REINT) ? LCK_CW : LCK_PW;
646 res_id[0] = de_tgtdir->d_inode->i_ino;
648 rc = ldlm_lock_match(mds->mds_local_namespace, res_id, LDLM_PLAIN,
649 NULL, 0, lock_mode, &tgtlockh);
651 LDLM_DEBUG_NOLOCK("enqueue res %Lu", res_id[0]);
652 rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
653 (struct lustre_handle *)&mds->mds_connh,
654 NULL, mds->mds_local_namespace, NULL,
655 res_id, LDLM_PLAIN, NULL, 0, lock_mode,
656 &flags, (void *)mds_lock_callback, NULL,
658 if (rc != ELDLM_OK) {
659 CERROR("lock enqueue: err: %d\n", rc);
660 GOTO(out_rename_tgtput, rc = -EIO);
663 ldlm_lock_dump((void *)(unsigned long)tgtlockh.addr);
665 double_lock(de_tgtdir, de_srcdir);
667 de_old = lookup_one_len(rec->ur_name, de_srcdir, rec->ur_namelen - 1);
668 if (IS_ERR(de_old)) {
669 CERROR("old child lookup error (%*s): %ld\n",
670 rec->ur_namelen - 1, rec->ur_name, PTR_ERR(de_old));
671 GOTO(out_rename_tgtdir, rc = -ENOENT);
674 de_new = lookup_one_len(rec->ur_tgt, de_tgtdir, rec->ur_tgtlen - 1);
675 if (IS_ERR(de_new)) {
676 CERROR("new child lookup error (%*s): %ld\n",
677 rec->ur_tgtlen - 1, rec->ur_tgt, PTR_ERR(de_new));
678 GOTO(out_rename_deold, rc = -ENOENT);
681 OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_RENAME_WRITE,
682 de_srcdir->d_inode->i_sb->s_dev);
684 handle = mds_fs_start(mds, de_tgtdir->d_inode, MDS_FSOP_RENAME);
686 GOTO(out_rename_denew, rc = PTR_ERR(handle));
688 rc = vfs_rename(de_srcdir->d_inode, de_old, de_tgtdir->d_inode, de_new,
693 rc = mds_update_last_rcvd(mds, handle, req);
695 err = mds_fs_commit(mds, de_tgtdir->d_inode, handle);
697 CERROR("error on commit: err = %d\n", err);
707 res_id[0] = de_old->d_inode->i_ino;
708 /* Take an exclusive lock on the resource that we're
709 * about to free, to force everyone to drop their
711 LDLM_DEBUG_NOLOCK("getting EX lock res %Lu", res_id[0]);
712 rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
713 (struct lustre_handle *)&mds->mds_connh,
714 NULL, mds->mds_local_namespace, NULL,
716 LDLM_PLAIN, NULL, 0, LCK_EX, &flags,
717 (void *)mds_lock_callback, NULL, 0,
720 CERROR("failed to get child inode lock (child ino %Ld, "
722 res_id[0], de_old->d_inode->i_ino);
728 ldlm_lock_decref(&oldhandle, LCK_EX);
729 rc = ldlm_cli_cancel(&oldhandle);
731 CERROR("failed to cancel child inode lock ino "
732 "%Ld: %d\n", res_id[0], rc);
735 double_up(&de_srcdir->d_inode->i_sem, &de_tgtdir->d_inode->i_sem);
736 ldlm_lock_decref(&tgtlockh, lock_mode);
740 ldlm_lock_decref(&srclockh, lock_mode);
748 typedef int (*mds_reinter)(struct mds_update_record *, int offset,
749 struct ptlrpc_request *);
751 static mds_reinter reinters[REINT_MAX+1] = {
752 [REINT_SETATTR] mds_reint_setattr,
753 [REINT_CREATE] mds_reint_create,
754 [REINT_UNLINK] mds_reint_unlink,
755 [REINT_LINK] mds_reint_link,
756 [REINT_RENAME] mds_reint_rename,
757 [REINT_RECREATE] mds_reint_recreate,
760 int mds_reint_rec(struct mds_update_record *rec, int offset,
761 struct ptlrpc_request *req)
763 struct mds_obd *mds = mds_req2mds(req);
764 struct obd_run_ctxt saved;
768 if (rec->ur_opcode < 1 || rec->ur_opcode > REINT_MAX) {
769 CERROR("opcode %d not valid\n", rec->ur_opcode);
770 rc = req->rq_status = -EINVAL;
774 push_ctxt(&saved, &mds->mds_ctxt);
775 rc = reinters[rec->ur_opcode](rec, offset, req);