Whamcloud - gitweb
LU-2598 tests: check nr_local in ofd_preprw()
[fs/lustre-release.git] / lustre / ofd / ofd_io.c
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2012, 2013, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  *
36  * lustre/ofd/ofd_io.c
37  *
38  * Author: Alex Tomas <bzzz@whamcloud.com>
39  */
40
41 #define DEBUG_SUBSYSTEM S_FILTER
42
43 #include "ofd_internal.h"
44
45 static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp,
46                            struct ofd_device *ofd, struct lu_fid *fid,
47                            struct lu_attr *la, int niocount,
48                            struct niobuf_remote *rnb, int *nr_local,
49                            struct niobuf_local *lnb,
50                            struct obd_trans_info *oti)
51 {
52         struct ofd_object       *fo;
53         int                      i, j, rc, tot_bytes = 0;
54
55         ENTRY;
56         LASSERT(env != NULL);
57
58         fo = ofd_object_find(env, ofd, fid);
59         if (IS_ERR(fo))
60                 RETURN(PTR_ERR(fo));
61         LASSERT(fo != NULL);
62
63         ofd_read_lock(env, fo);
64         if (!ofd_object_exists(fo))
65                 GOTO(unlock, rc = -ENOENT);
66
67         /* parse remote buffers to local buffers and prepare the latter */
68         *nr_local = 0;
69         for (i = 0, j = 0; i < niocount; i++) {
70                 rc = dt_bufs_get(env, ofd_object_child(fo), rnb + i,
71                                  lnb + j, 0, ofd_object_capa(env, fo));
72                 if (unlikely(rc < 0))
73                         GOTO(buf_put, rc);
74                 LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
75                 /* correct index for local buffers to continue with */
76                 j += rc;
77                 *nr_local += rc;
78                 LASSERT(j <= PTLRPC_MAX_BRW_PAGES);
79                 tot_bytes += rnb[i].rnb_len;
80         }
81
82         LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
83         rc = dt_attr_get(env, ofd_object_child(fo), la,
84                          ofd_object_capa(env, fo));
85         if (unlikely(rc))
86                 GOTO(buf_put, rc);
87
88         rc = dt_read_prep(env, ofd_object_child(fo), lnb, *nr_local);
89         if (unlikely(rc))
90                 GOTO(buf_put, rc);
91         lprocfs_counter_add(ofd_obd(ofd)->obd_stats,
92                             LPROC_OFD_READ_BYTES, tot_bytes);
93         ofd_counter_incr(exp, LPROC_OFD_STATS_READ,
94                          oti->oti_jobid, tot_bytes);
95         RETURN(0);
96
97 buf_put:
98         dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
99 unlock:
100         ofd_read_unlock(env, fo);
101         ofd_object_put(env, fo);
102         return rc;
103 }
104
105 static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
106                             struct ofd_device *ofd, struct lu_fid *fid,
107                             struct lu_attr *la, struct obdo *oa,
108                             int objcount, struct obd_ioobj *obj,
109                             struct niobuf_remote *rnb, int *nr_local,
110                             struct niobuf_local *lnb,
111                             struct obd_trans_info *oti)
112 {
113         struct ofd_object       *fo;
114         int                      i, j, k, rc = 0, tot_bytes = 0;
115
116         ENTRY;
117         LASSERT(env != NULL);
118         LASSERT(objcount == 1);
119
120         if (unlikely(exp->exp_obd->obd_recovering)) {
121                 struct ofd_thread_info *info = ofd_info(env);
122
123                 /* copied from ofd_precreate_object */
124                 /* XXX this should be consolidated to use the same code
125                  *     instead of a copy, due to the ongoing risk of bugs. */
126                 memset(&info->fti_attr, 0, sizeof(info->fti_attr));
127                 info->fti_attr.la_valid = LA_TYPE | LA_MODE;
128                 info->fti_attr.la_mode = S_IFREG | S_ISUID | S_ISGID | 0666;
129                 info->fti_attr.la_valid |= LA_ATIME | LA_MTIME | LA_CTIME;
130                 /* Initialize a/c/m time so any client timestamp will always
131                  * be newer and update the inode. ctime = 0 is also handled
132                  * specially in osd_inode_setattr().  See LU-221, LU-1042 */
133                 info->fti_attr.la_atime = 0;
134                 info->fti_attr.la_mtime = 0;
135                 info->fti_attr.la_ctime = 0;
136
137                 fo = ofd_object_find_or_create(env, ofd, fid, &info->fti_attr);
138         } else {
139                 fo = ofd_object_find(env, ofd, fid);
140         }
141
142         if (IS_ERR(fo))
143                 GOTO(out, rc = PTR_ERR(fo));
144         LASSERT(fo != NULL);
145
146         ofd_read_lock(env, fo);
147         if (!ofd_object_exists(fo)) {
148                 CERROR("%s: BRW to missing obj "DOSTID"\n",
149                        exp->exp_obd->obd_name, POSTID(&obj->ioo_oid));
150                 ofd_read_unlock(env, fo);
151                 ofd_object_put(env, fo);
152                 GOTO(out, rc = -ENOENT);
153         }
154
155         /* Always sync if syncjournal parameter is set */
156         oti->oti_sync_write = ofd->ofd_syncjournal;
157
158         /* Process incoming grant info, set OBD_BRW_GRANTED flag and grant some
159          * space back if possible */
160         ofd_grant_prepare_write(env, exp, oa, rnb, obj->ioo_bufcnt);
161
162         /* parse remote buffers to local buffers and prepare the latter */
163         *nr_local = 0;
164         for (i = 0, j = 0; i < obj->ioo_bufcnt; i++) {
165                 rc = dt_bufs_get(env, ofd_object_child(fo),
166                                  rnb + i, lnb + j, 1,
167                                  ofd_object_capa(env, fo));
168                 if (unlikely(rc < 0))
169                         GOTO(err, rc);
170                 LASSERT(rc <= PTLRPC_MAX_BRW_PAGES);
171                 /* correct index for local buffers to continue with */
172                 for (k = 0; k < rc; k++) {
173                         lnb[j+k].lnb_flags = rnb[i].rnb_flags;
174                         if (!(rnb[i].rnb_flags & OBD_BRW_GRANTED))
175                                 lnb[j+k].lnb_rc = -ENOSPC;
176                         if (!(rnb[i].rnb_flags & OBD_BRW_ASYNC))
177                                 oti->oti_sync_write = 1;
178                         /* remote client can't break through quota */
179                         if (exp_connect_rmtclient(exp))
180                                 lnb[j+k].lnb_flags &= ~OBD_BRW_NOQUOTA;
181                 }
182                 j += rc;
183                 *nr_local += rc;
184                 LASSERT(j <= PTLRPC_MAX_BRW_PAGES);
185                 tot_bytes += rnb[i].rnb_len;
186         }
187         LASSERT(*nr_local > 0 && *nr_local <= PTLRPC_MAX_BRW_PAGES);
188
189         rc = dt_write_prep(env, ofd_object_child(fo), lnb, *nr_local);
190         if (unlikely(rc != 0))
191                 GOTO(err, rc);
192
193         lprocfs_counter_add(ofd_obd(ofd)->obd_stats,
194                             LPROC_OFD_WRITE_BYTES, tot_bytes);
195         ofd_counter_incr(exp, LPROC_OFD_STATS_WRITE,
196                          oti->oti_jobid, tot_bytes);
197         RETURN(0);
198 err:
199         dt_bufs_put(env, ofd_object_child(fo), lnb, *nr_local);
200         ofd_read_unlock(env, fo);
201         /* ofd_grant_prepare_write() was called, so we must commit */
202         ofd_grant_commit(env, exp, rc);
203 out:
204         /* let's still process incoming grant information packed in the oa,
205          * but without enforcing grant since we won't proceed with the write.
206          * Just like a read request actually. */
207         ofd_grant_prepare_read(env, exp, oa);
208         return rc;
209 }
210
211 int ofd_preprw(const struct lu_env* env, int cmd, struct obd_export *exp,
212                struct obdo *oa, int objcount, struct obd_ioobj *obj,
213                struct niobuf_remote *rnb, int *nr_local,
214                struct niobuf_local *lnb, struct obd_trans_info *oti,
215                struct lustre_capa *capa)
216 {
217         struct ofd_device       *ofd = ofd_exp(exp);
218         struct ofd_thread_info  *info;
219         int                      rc = 0;
220
221         if (*nr_local > PTLRPC_MAX_BRW_PAGES) {
222                 CERROR("%s: bulk has too many pages %d, which exceeds the"
223                        "maximum pages per RPC of %d\n",
224                        exp->exp_obd->obd_name, *nr_local, PTLRPC_MAX_BRW_PAGES);
225                 RETURN(-EPROTO);
226         }
227
228         rc = lu_env_refill((struct lu_env *)env);
229         LASSERT(rc == 0);
230         info = ofd_info_init(env, exp);
231
232         LASSERT(oa != NULL);
233
234         if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
235                 struct ofd_seq          *oseq;
236                 oseq = ofd_seq_load(env, ofd, ostid_seq(&oa->o_oi));
237                 if (IS_ERR(oseq)) {
238                         CERROR("%s: Can not find seq for "DOSTID
239                                ": rc = %ld\n", ofd_name(ofd), POSTID(&oa->o_oi),
240                                PTR_ERR(oseq));
241                         RETURN(-EINVAL);
242                 }
243
244                 if (oseq->os_destroys_in_progress == 0) {
245                         /* don't fail lookups for orphan recovery, it causes
246                          * later LBUGs when objects still exist during
247                          * precreate */
248                         ofd_seq_put(env, oseq);
249                         RETURN(-ENOENT);
250                 }
251                 ofd_seq_put(env, oseq);
252         }
253
254         LASSERT(objcount == 1);
255         LASSERT(obj->ioo_bufcnt > 0);
256
257         rc = ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
258         if (unlikely(rc != 0))
259                 RETURN(rc);
260
261         if (cmd == OBD_BRW_WRITE) {
262                 rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
263                                    capa, CAPA_OPC_OSS_WRITE);
264                 if (rc == 0) {
265                         la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
266                         rc = ofd_preprw_write(env, exp, ofd, &info->fti_fid,
267                                               &info->fti_attr, oa, objcount,
268                                               obj, rnb, nr_local, lnb, oti);
269                 }
270         } else if (cmd == OBD_BRW_READ) {
271                 rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
272                                    capa, CAPA_OPC_OSS_READ);
273                 if (rc == 0) {
274                         ofd_grant_prepare_read(env, exp, oa);
275                         rc = ofd_preprw_read(env, exp, ofd, &info->fti_fid,
276                                              &info->fti_attr, obj->ioo_bufcnt,
277                                              rnb, nr_local, lnb, oti);
278                         obdo_from_la(oa, &info->fti_attr, LA_ATIME);
279                 }
280         } else {
281                 CERROR("%s: wrong cmd %d received!\n",
282                        exp->exp_obd->obd_name, cmd);
283                 rc = -EPROTO;
284         }
285         RETURN(rc);
286 }
287
288 static int
289 ofd_commitrw_read(const struct lu_env *env, struct ofd_device *ofd,
290                   struct lu_fid *fid, int objcount, int niocount,
291                   struct niobuf_local *lnb)
292 {
293         struct ofd_object *fo;
294
295         ENTRY;
296
297         LASSERT(niocount > 0);
298
299         fo = ofd_object_find(env, ofd, fid);
300         if (IS_ERR(fo))
301                 RETURN(PTR_ERR(fo));
302         LASSERT(fo != NULL);
303         LASSERT(ofd_object_exists(fo));
304         dt_bufs_put(env, ofd_object_child(fo), lnb, niocount);
305
306         ofd_read_unlock(env, fo);
307         ofd_object_put(env, fo);
308         /* second put is pair to object_get in ofd_preprw_read */
309         ofd_object_put(env, fo);
310
311         RETURN(0);
312 }
313
314 static int
315 ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
316                    struct ofd_object *ofd_obj, struct lu_attr *la,
317                    struct filter_fid *ff)
318 {
319         struct ofd_thread_info  *info = ofd_info(env);
320         __u64                    valid = la->la_valid;
321         int                      rc;
322         struct thandle          *th;
323         struct dt_object        *dt_obj;
324         int                      ff_needed = 0;
325
326         ENTRY;
327
328         LASSERT(la);
329
330         dt_obj = ofd_object_child(ofd_obj);
331         LASSERT(dt_obj != NULL);
332
333         la->la_valid &= LA_UID | LA_GID;
334
335         rc = ofd_attr_handle_ugid(env, ofd_obj, la, 0 /* !is_setattr */);
336         if (rc != 0)
337                 GOTO(out, rc);
338
339         if (ff != NULL) {
340                 rc = ofd_object_ff_check(env, ofd_obj);
341                 if (rc == -ENODATA)
342                         ff_needed = 1;
343                 else if (rc < 0)
344                         GOTO(out, rc);
345         }
346
347         if (!la->la_valid && !ff_needed)
348                 /* no attributes to set */
349                 GOTO(out, rc = 0);
350
351         th = ofd_trans_create(env, ofd);
352         if (IS_ERR(th))
353                 GOTO(out, rc = PTR_ERR(th));
354
355         if (la->la_valid) {
356                 rc = dt_declare_attr_set(env, dt_obj, la, th);
357                 if (rc)
358                         GOTO(out_tx, rc);
359         }
360
361         if (ff_needed) {
362                 info->fti_buf.lb_buf = ff;
363                 info->fti_buf.lb_len = sizeof(*ff);
364                 rc = dt_declare_xattr_set(env, dt_obj, &info->fti_buf,
365                                           XATTR_NAME_FID, 0, th);
366                 if (rc)
367                         GOTO(out_tx, rc);
368         }
369
370         /* We don't need a transno for this operation which will be re-executed
371          * anyway when the OST_WRITE (with a transno assigned) is replayed */
372         rc = dt_trans_start_local(env, ofd->ofd_osd , th);
373         if (rc)
374                 GOTO(out_tx, rc);
375
376         /* set uid/gid */
377         if (la->la_valid) {
378                 rc = dt_attr_set(env, dt_obj, la, th,
379                                  ofd_object_capa(env, ofd_obj));
380                 if (rc)
381                         GOTO(out_tx, rc);
382         }
383
384         /* set filter fid EA */
385         if (ff_needed) {
386                 rc = dt_xattr_set(env, dt_obj, &info->fti_buf, XATTR_NAME_FID,
387                                   0, th, BYPASS_CAPA);
388                 if (rc)
389                         GOTO(out_tx, rc);
390         }
391
392         EXIT;
393 out_tx:
394         dt_trans_stop(env, ofd->ofd_osd, th);
395 out:
396         la->la_valid = valid;
397         return rc;
398 }
399
400 static int
401 ofd_commitrw_write(const struct lu_env *env, struct ofd_device *ofd,
402                    struct lu_fid *fid, struct lu_attr *la,
403                    struct filter_fid *ff, int objcount,
404                    int niocount, struct niobuf_local *lnb,
405                    struct obd_trans_info *oti, int old_rc)
406 {
407         struct ofd_thread_info  *info = ofd_info(env);
408         struct ofd_object       *fo;
409         struct dt_object        *o;
410         struct thandle          *th;
411         int                      rc = 0;
412         int                      retries = 0;
413
414         ENTRY;
415
416         LASSERT(objcount == 1);
417
418         fo = ofd_object_find(env, ofd, fid);
419         LASSERT(fo != NULL);
420         LASSERT(ofd_object_exists(fo));
421
422         o = ofd_object_child(fo);
423         LASSERT(o != NULL);
424
425         if (old_rc)
426                 GOTO(out, rc = old_rc);
427
428         /*
429          * The first write to each object must set some attributes.  It is
430          * important to set the uid/gid before calling
431          * dt_declare_write_commit() since quota enforcement is now handled in
432          * declare phases.
433          */
434         rc = ofd_write_attr_set(env, ofd, fo, la, ff);
435         if (rc)
436                 GOTO(out, rc);
437
438         la->la_valid &= LA_ATIME | LA_MTIME | LA_CTIME;
439
440 retry:
441         th = ofd_trans_create(env, ofd);
442         if (IS_ERR(th))
443                 GOTO(out, rc = PTR_ERR(th));
444
445         th->th_sync |= oti->oti_sync_write;
446
447         if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
448                 GOTO(out_stop, rc = -EINPROGRESS);
449
450         rc = dt_declare_write_commit(env, o, lnb, niocount, th);
451         if (rc)
452                 GOTO(out_stop, rc);
453
454         if (la->la_valid) {
455                 /* update [mac]time if needed */
456                 rc = dt_declare_attr_set(env, o, la, th);
457                 if (rc)
458                         GOTO(out_stop, rc);
459         }
460
461         rc = ofd_trans_start(env, ofd, fo, th);
462         if (rc)
463                 GOTO(out_stop, rc);
464
465         rc = dt_write_commit(env, o, lnb, niocount, th);
466         if (rc)
467                 GOTO(out_stop, rc);
468
469         if (la->la_valid) {
470                 rc = dt_attr_set(env, o, la, th, ofd_object_capa(env, fo));
471                 if (rc)
472                         GOTO(out_stop, rc);
473         }
474
475         /* get attr to return */
476         rc = dt_attr_get(env, o, la, ofd_object_capa(env, fo));
477
478 out_stop:
479         /* Force commit to make the just-deleted blocks
480          * reusable. LU-456 */
481         if (rc == -ENOSPC)
482                 th->th_sync = 1;
483
484         ofd_trans_stop(env, ofd, th, rc);
485         if (rc == -ENOSPC && retries++ < 3) {
486                 CDEBUG(D_INODE, "retry after force commit, retries:%d\n",
487                        retries);
488                 goto retry;
489         }
490
491 out:
492         dt_bufs_put(env, o, lnb, niocount);
493         ofd_read_unlock(env, fo);
494         ofd_object_put(env, fo);
495         /* second put is pair to object_get in ofd_preprw_write */
496         ofd_object_put(env, fo);
497         ofd_grant_commit(env, info->fti_exp, old_rc);
498         RETURN(rc);
499 }
500
501 int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
502                  struct obdo *oa, int objcount, struct obd_ioobj *obj,
503                  struct niobuf_remote *rnb, int npages,
504                  struct niobuf_local *lnb, struct obd_trans_info *oti,
505                  int old_rc)
506 {
507         struct ofd_thread_info  *info;
508         struct ofd_mod_data     *fmd;
509         __u64                    valid;
510         struct ofd_device       *ofd = ofd_exp(exp);
511         struct filter_fid       *ff = NULL;
512         int                      rc = 0;
513
514         info = ofd_info(env);
515         ofd_oti2info(info, oti);
516
517         LASSERT(npages > 0);
518
519         rc = ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
520         if (unlikely(rc != 0))
521                 RETURN(rc);
522         if (cmd == OBD_BRW_WRITE) {
523                 /* Don't update timestamps if this write is older than a
524                  * setattr which modifies the timestamps. b=10150 */
525
526                 /* XXX when we start having persistent reservations this needs
527                  * to be changed to ofd_fmd_get() to create the fmd if it
528                  * doesn't already exist so we can store the reservation handle
529                  * there. */
530                 valid = OBD_MD_FLUID | OBD_MD_FLGID;
531                 fmd = ofd_fmd_find(exp, &info->fti_fid);
532                 if (!fmd || fmd->fmd_mactime_xid < info->fti_xid)
533                         valid |= OBD_MD_FLATIME | OBD_MD_FLMTIME |
534                                  OBD_MD_FLCTIME;
535                 ofd_fmd_put(exp, fmd);
536                 la_from_obdo(&info->fti_attr, oa, valid);
537
538                 if (oa->o_valid & OBD_MD_FLFID) {
539                         ff = &info->fti_mds_fid;
540                         ofd_prepare_fidea(ff, oa);
541                 }
542
543                 rc = ofd_commitrw_write(env, ofd, &info->fti_fid,
544                                         &info->fti_attr, ff, objcount, npages,
545                                         lnb, oti, old_rc);
546                 if (rc == 0)
547                         obdo_from_la(oa, &info->fti_attr,
548                                      OFD_VALID_FLAGS | LA_GID | LA_UID);
549                 else
550                         obdo_from_la(oa, &info->fti_attr, LA_GID | LA_UID);
551
552                 /* don't report overquota flag if we failed before reaching
553                  * commit */
554                 if (old_rc == 0 && (rc == 0 || rc == -EDQUOT)) {
555                         /* return the overquota flags to client */
556                         if (lnb[0].lnb_flags & OBD_BRW_OVER_USRQUOTA) {
557                                 if (oa->o_valid & OBD_MD_FLFLAGS)
558                                         oa->o_flags |= OBD_FL_NO_USRQUOTA;
559                                 else
560                                         oa->o_flags = OBD_FL_NO_USRQUOTA;
561                         }
562
563                         if (lnb[0].lnb_flags & OBD_BRW_OVER_GRPQUOTA) {
564                                 if (oa->o_valid & OBD_MD_FLFLAGS)
565                                         oa->o_flags |= OBD_FL_NO_GRPQUOTA;
566                                 else
567                                         oa->o_flags = OBD_FL_NO_GRPQUOTA;
568                         }
569
570                         oa->o_valid |= OBD_MD_FLFLAGS;
571                         oa->o_valid |= OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA;
572                 }
573         } else if (cmd == OBD_BRW_READ) {
574                 struct ldlm_namespace *ns = ofd->ofd_namespace;
575
576                 /* If oa != NULL then ofd_preprw_read updated the inode
577                  * atime and we should update the lvb so that other glimpses
578                  * will also get the updated value. bug 5972 */
579                 if (oa && ns && ns->ns_lvbo && ns->ns_lvbo->lvbo_update) {
580                          struct ldlm_resource *rs = NULL;
581
582                         ost_fid_build_resid(&info->fti_fid, &info->fti_resid);
583                         rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
584                                                LDLM_EXTENT, 0);
585                         if (rs != NULL) {
586                                 ns->ns_lvbo->lvbo_update(rs, NULL, 1);
587                                 ldlm_resource_putref(rs);
588                         }
589                 }
590                 rc = ofd_commitrw_read(env, ofd, &info->fti_fid, objcount,
591                                           npages, lnb);
592                 if (old_rc)
593                         rc = old_rc;
594         } else {
595                 LBUG();
596                 rc = -EPROTO;
597         }
598
599         ofd_info2oti(info, oti);
600         RETURN(rc);
601 }