Whamcloud - gitweb
e85ba4d9fa1037a97823e72fac871d6a361d109f
[fs/lustre-release.git] / lustre / ofd / ofd_fs.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, 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_fs.c
37  *
38  * Author: Alexey Zhuravlev <bzzz@whamcloud.com>
39  * Author: Mikhail Pershin <tappro@whamcloud.com>
40  */
41
42 #define DEBUG_SUBSYSTEM S_FILTER
43
44 #include "ofd_internal.h"
45
46 int ofd_record_write(const struct lu_env *env, struct ofd_device *ofd,
47                      struct dt_object *dt, struct lu_buf *buf, loff_t *off)
48 {
49         struct thandle  *th;
50         int              rc;
51
52         ENTRY;
53
54         LASSERT(dt);
55
56         th = dt_trans_create(env, ofd->ofd_osd);
57         if (IS_ERR(th))
58                 RETURN(PTR_ERR(th));
59
60         rc = dt_declare_record_write(env, dt, buf->lb_len, *off, th);
61         if (rc == 0) {
62                 rc = dt_trans_start_local(env, ofd->ofd_osd, th);
63                 if (rc == 0)
64                         rc = dt_record_write(env, dt, buf, off, th);
65         }
66         dt_trans_stop(env, ofd->ofd_osd, th);
67
68         RETURN(rc);
69 }
70
71 int ofd_precreate_batch(struct ofd_device *ofd, int batch)
72 {
73         int count;
74
75         spin_lock(&ofd->ofd_batch_lock);
76         count = min(ofd->ofd_precreate_batch, batch);
77         spin_unlock(&ofd->ofd_batch_lock);
78
79         return count;
80 }
81
82 struct ofd_seq *ofd_seq_get(struct ofd_device *ofd, obd_seq seq)
83 {
84         struct ofd_seq *oseq;
85
86         read_lock(&ofd->ofd_seq_list_lock);
87         cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
88                 if (oseq->os_seq == seq) {
89                         cfs_atomic_inc(&oseq->os_refc);
90                         read_unlock(&ofd->ofd_seq_list_lock);
91                         return oseq;
92                 }
93         }
94         read_unlock(&ofd->ofd_seq_list_lock);
95         return NULL;
96 }
97
98 static void ofd_seq_destroy(const struct lu_env *env,
99                             struct ofd_seq *oseq)
100 {
101         LASSERT(cfs_list_empty(&oseq->os_list));
102         LASSERT(oseq->os_lastid_obj != NULL);
103         lu_object_put(env, &oseq->os_lastid_obj->do_lu);
104         OBD_FREE_PTR(oseq);
105 }
106
107 void ofd_seq_put(const struct lu_env *env, struct ofd_seq *oseq)
108 {
109         if (cfs_atomic_dec_and_test(&oseq->os_refc))
110                 ofd_seq_destroy(env, oseq);
111 }
112
113 static void ofd_seq_delete(const struct lu_env *env, struct ofd_seq *oseq)
114 {
115         cfs_list_del_init(&oseq->os_list);
116         ofd_seq_put(env, oseq);
117 }
118
119 /**
120  * Add a new sequence to the OFD device.
121  *
122  * \param ofd OFD device
123  * \param new_seq new sequence to be added
124  *
125  * \retval the seq to be added or the existing seq
126  **/
127 static struct ofd_seq *ofd_seq_add(const struct lu_env *env,
128                                    struct ofd_device *ofd,
129                                    struct ofd_seq *new_seq)
130 {
131         struct ofd_seq *os = NULL;
132
133         write_lock(&ofd->ofd_seq_list_lock);
134         cfs_list_for_each_entry(os, &ofd->ofd_seq_list, os_list) {
135                 if (os->os_seq == new_seq->os_seq) {
136                         cfs_atomic_inc(&os->os_refc);
137                         write_unlock(&ofd->ofd_seq_list_lock);
138                         /* The seq has not been added to the list */
139                         ofd_seq_put(env, new_seq);
140                         return os;
141                 }
142         }
143         cfs_atomic_inc(&new_seq->os_refc);
144         cfs_list_add_tail(&new_seq->os_list, &ofd->ofd_seq_list);
145         ofd->ofd_seq_count++;
146         write_unlock(&ofd->ofd_seq_list_lock);
147         return new_seq;
148 }
149
150 obd_id ofd_seq_last_oid(struct ofd_seq *oseq)
151 {
152         obd_id id;
153
154         spin_lock(&oseq->os_last_oid_lock);
155         id = oseq->os_last_oid;
156         spin_unlock(&oseq->os_last_oid_lock);
157
158         return id;
159 }
160
161 void ofd_seq_last_oid_set(struct ofd_seq *oseq, obd_id id)
162 {
163         spin_lock(&oseq->os_last_oid_lock);
164         if (likely(oseq->os_last_oid < id))
165                 oseq->os_last_oid = id;
166         spin_unlock(&oseq->os_last_oid_lock);
167 }
168
169 int ofd_seq_last_oid_write(const struct lu_env *env, struct ofd_device *ofd,
170                            struct ofd_seq *oseq)
171 {
172         struct ofd_thread_info  *info = ofd_info(env);
173         obd_id                   tmp;
174         int                      rc;
175
176         ENTRY;
177
178         info->fti_buf.lb_buf = &tmp;
179         info->fti_buf.lb_len = sizeof(tmp);
180         info->fti_off = 0;
181
182         CDEBUG(D_INODE, "%s: write last_objid for seq "LPX64" : "LPX64"\n",
183                ofd_name(ofd), oseq->os_seq, ofd_seq_last_oid(oseq));
184
185         tmp = cpu_to_le64(ofd_seq_last_oid(oseq));
186
187         rc = ofd_record_write(env, ofd, oseq->os_lastid_obj, &info->fti_buf,
188                               &info->fti_off);
189         RETURN(rc);
190 }
191
192 void ofd_seqs_fini(const struct lu_env *env, struct ofd_device *ofd)
193 {
194         struct ofd_seq  *oseq;
195         struct ofd_seq  *tmp;
196         cfs_list_t       dispose;
197
198         CFS_INIT_LIST_HEAD(&dispose);
199         write_lock(&ofd->ofd_seq_list_lock);
200         cfs_list_for_each_entry_safe(oseq, tmp, &ofd->ofd_seq_list, os_list) {
201                 cfs_list_move(&oseq->os_list, &dispose);
202         }
203         write_unlock(&ofd->ofd_seq_list_lock);
204
205         while (!cfs_list_empty(&dispose)) {
206                 oseq = container_of0(dispose.next, struct ofd_seq, os_list);
207                 ofd_seq_delete(env, oseq);
208         }
209
210         LASSERT(cfs_list_empty(&ofd->ofd_seq_list));
211         return;
212 }
213
214 struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
215                              obd_seq seq)
216 {
217         struct ofd_thread_info  *info = ofd_info(env);
218         struct ofd_seq          *oseq = NULL;
219         struct dt_object        *dob;
220         obd_id                   lastid;
221         int                      rc;
222
223         ENTRY;
224
225         /* if seq is already initialized */
226         oseq = ofd_seq_get(ofd, seq);
227         if (oseq != NULL)
228                 RETURN(oseq);
229
230         OBD_ALLOC_PTR(oseq);
231         if (oseq == NULL)
232                 RETURN(ERR_PTR(-ENOMEM));
233
234         lu_last_id_fid(&info->fti_fid, seq);
235         memset(&info->fti_attr, 0, sizeof(info->fti_attr));
236         info->fti_attr.la_valid = LA_MODE;
237         info->fti_attr.la_mode = S_IFREG |  S_IRUGO | S_IWUSR;
238         info->fti_dof.dof_type = dt_mode_to_dft(S_IFREG);
239
240         /* create object tracking per-seq last created
241          * id to be used by orphan recovery mechanism */
242         dob = dt_find_or_create(env, ofd->ofd_osd, &info->fti_fid,
243                                 &info->fti_dof, &info->fti_attr);
244         if (IS_ERR(dob)) {
245                 OBD_FREE_PTR(oseq);
246                 RETURN((void *)dob);
247         }
248
249         oseq->os_lastid_obj = dob;
250
251         CFS_INIT_LIST_HEAD(&oseq->os_list);
252         mutex_init(&oseq->os_create_lock);
253         spin_lock_init(&oseq->os_last_oid_lock);
254         oseq->os_seq = seq;
255
256         cfs_atomic_set(&oseq->os_refc, 1);
257
258         rc = dt_attr_get(env, dob, &info->fti_attr, BYPASS_CAPA);
259         if (rc)
260                 GOTO(cleanup, rc);
261
262         if (info->fti_attr.la_size == 0) {
263                 /* object is just created, initialize last id */
264                 oseq->os_last_oid = OFD_INIT_OBJID;
265                 ofd_seq_last_oid_write(env, ofd, oseq);
266         } else if (info->fti_attr.la_size == sizeof(lastid)) {
267                 info->fti_off = 0;
268                 info->fti_buf.lb_buf = &lastid;
269                 info->fti_buf.lb_len = sizeof(lastid);
270
271                 rc = dt_record_read(env, dob, &info->fti_buf, &info->fti_off);
272                 if (rc) {
273                         CERROR("%s: can't read last_id: rc = %d\n",
274                                 ofd_name(ofd), rc);
275                         GOTO(cleanup, rc);
276                 }
277                 oseq->os_last_oid = le64_to_cpu(lastid);
278         } else {
279                 CERROR("%s: corrupted size "LPU64" LAST_ID of seq "LPX64"\n",
280                         ofd_name(ofd), (__u64)info->fti_attr.la_size, seq);
281                 GOTO(cleanup, rc = -EINVAL);
282         }
283
284         oseq = ofd_seq_add(env, ofd, oseq);
285         RETURN(oseq);
286 cleanup:
287         ofd_seq_put(env, oseq);
288         return ERR_PTR(rc);
289 }
290
291 /* object sequence management */
292 int ofd_seqs_init(const struct lu_env *env, struct ofd_device *ofd)
293 {
294         rwlock_init(&ofd->ofd_seq_list_lock);
295         CFS_INIT_LIST_HEAD(&ofd->ofd_seq_list);
296         ofd->ofd_seq_count = 0;
297         return 0;
298 }
299
300 int ofd_clients_data_init(const struct lu_env *env, struct ofd_device *ofd,
301                           unsigned long fsize)
302 {
303         struct obd_device               *obd = ofd_obd(ofd);
304         struct lr_server_data           *lsd = &ofd->ofd_lut.lut_lsd;
305         struct lsd_client_data          *lcd = NULL;
306         struct filter_export_data       *fed;
307         int                              cl_idx;
308         int                              rc = 0;
309         loff_t                           off = lsd->lsd_client_start;
310
311         CLASSERT(offsetof(struct lsd_client_data, lcd_padding) +
312                  sizeof(lcd->lcd_padding) == LR_CLIENT_SIZE);
313
314         OBD_ALLOC_PTR(lcd);
315         if (lcd == NULL)
316                 RETURN(-ENOMEM);
317
318         for (cl_idx = 0; off < fsize; cl_idx++) {
319                 struct obd_export       *exp;
320                 __u64                    last_rcvd;
321
322                 /* Don't assume off is incremented properly by
323                  * fsfilt_read_record(), in case sizeof(*lcd)
324                  * isn't the same as fsd->lsd_client_size.  */
325                 off = lsd->lsd_client_start + cl_idx * lsd->lsd_client_size;
326                 rc = tgt_client_data_read(env, &ofd->ofd_lut, lcd, &off, cl_idx);
327                 if (rc) {
328                         CERROR("%s: error reading FILT %s idx %d off %llu: "
329                                "rc = %d\n", ofd_name(ofd), LAST_RCVD, cl_idx,
330                                off, rc);
331                         rc = 0;
332                         break; /* read error shouldn't cause startup to fail */
333                 }
334
335                 if (lcd->lcd_uuid[0] == '\0') {
336                         CDEBUG(D_INFO, "skipping zeroed client at offset %d\n",
337                                cl_idx);
338                         continue;
339                 }
340
341                 last_rcvd = lcd->lcd_last_transno;
342
343                 /* These exports are cleaned up by ofd_disconnect(), so they
344                  * need to be set up like real exports as ofd_connect() does.
345                  */
346                 exp = class_new_export(obd, (struct obd_uuid *)lcd->lcd_uuid);
347
348                 CDEBUG(D_HA, "RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64
349                        " srv lr: "LPU64"\n", lcd->lcd_uuid, cl_idx,
350                        last_rcvd, lsd->lsd_last_transno);
351
352                 if (IS_ERR(exp)) {
353                         if (PTR_ERR(exp) == -EALREADY) {
354                                 /* export already exists, zero out this one */
355                                 CERROR("%s: Duplicate export %s!\n",
356                                        ofd_name(ofd), lcd->lcd_uuid);
357                                 continue;
358                         }
359                         GOTO(err_out, rc = PTR_ERR(exp));
360                 }
361
362                 fed = &exp->exp_filter_data;
363                 *fed->fed_ted.ted_lcd = *lcd;
364
365                 rc = tgt_client_add(env, exp, cl_idx);
366                 LASSERTF(rc == 0, "rc = %d\n", rc); /* can't fail existing */
367                 /* VBR: set export last committed version */
368                 exp->exp_last_committed = last_rcvd;
369                 spin_lock(&exp->exp_lock);
370                 exp->exp_connecting = 0;
371                 exp->exp_in_recovery = 0;
372                 spin_unlock(&exp->exp_lock);
373                 obd->obd_max_recoverable_clients++;
374                 class_export_put(exp);
375
376                 /* Need to check last_rcvd even for duplicated exports. */
377                 CDEBUG(D_OTHER, "client at idx %d has last_rcvd = "LPU64"\n",
378                        cl_idx, last_rcvd);
379
380                 spin_lock(&ofd->ofd_lut.lut_translock);
381                 if (last_rcvd > lsd->lsd_last_transno)
382                         lsd->lsd_last_transno = last_rcvd;
383                 spin_unlock(&ofd->ofd_lut.lut_translock);
384         }
385
386 err_out:
387         OBD_FREE_PTR(lcd);
388         RETURN(rc);
389 }
390
391 int ofd_server_data_init(const struct lu_env *env, struct ofd_device *ofd)
392 {
393         struct ofd_thread_info  *info = ofd_info(env);
394         struct lr_server_data   *lsd = &ofd->ofd_lut.lut_lsd;
395         struct obd_device       *obd = ofd_obd(ofd);
396         unsigned long           last_rcvd_size;
397         __u32                   index;
398         int                     rc;
399
400         rc = dt_attr_get(env, ofd->ofd_lut.lut_last_rcvd, &info->fti_attr,
401                          BYPASS_CAPA);
402         if (rc)
403                 RETURN(rc);
404
405         last_rcvd_size = (unsigned long)info->fti_attr.la_size;
406
407         /* ensure padding in the struct is the correct size */
408         CLASSERT (offsetof(struct lr_server_data, lsd_padding) +
409                   sizeof(lsd->lsd_padding) == LR_SERVER_SIZE);
410
411         rc = server_name2index(obd->obd_name, &index, NULL);
412         if (rc < 0) {
413                 CERROR("%s: Can not get index from obd_name: rc = %d\n",
414                        obd->obd_name, rc);
415                 RETURN(rc);
416         }
417
418         if (last_rcvd_size == 0) {
419                 LCONSOLE_WARN("%s: new disk, initializing\n", obd->obd_name);
420
421                 memcpy(lsd->lsd_uuid, obd->obd_uuid.uuid,
422                        sizeof(lsd->lsd_uuid));
423                 lsd->lsd_last_transno = 0;
424                 lsd->lsd_mount_count = 0;
425                 lsd->lsd_server_size = LR_SERVER_SIZE;
426                 lsd->lsd_client_start = LR_CLIENT_START;
427                 lsd->lsd_client_size = LR_CLIENT_SIZE;
428                 lsd->lsd_subdir_count = FILTER_SUBDIR_COUNT;
429                 lsd->lsd_feature_incompat = OBD_INCOMPAT_OST;
430                 lsd->lsd_osd_index = index;
431         } else {
432                 rc = tgt_server_data_read(env, &ofd->ofd_lut);
433                 if (rc) {
434                         CDEBUG(D_INODE,"OBD ofd: error reading %s: rc %d\n",
435                                LAST_RCVD, rc);
436                         GOTO(err_fsd, rc);
437                 }
438                 if (strcmp((char *)lsd->lsd_uuid,
439                            (char *)obd->obd_uuid.uuid)) {
440                         LCONSOLE_ERROR("Trying to start OBD %s using the wrong"
441                                        " disk %s. Were the /dev/ assignments "
442                                        "rearranged?\n",
443                                        obd->obd_uuid.uuid, lsd->lsd_uuid);
444                         GOTO(err_fsd, rc = -EINVAL);
445                 }
446
447                 if (lsd->lsd_osd_index == 0) {
448                         lsd->lsd_osd_index = index;
449                 } else if (lsd->lsd_osd_index != index) {
450                         LCONSOLE_ERROR("%s: index %d in last rcvd is different"
451                                        " with the index %d in config log."
452                                        " It might be disk corruption!\n",
453                                        obd->obd_name, lsd->lsd_osd_index,
454                                        index);
455                         GOTO(err_fsd, rc = -EINVAL);
456                 }
457         }
458
459         lsd->lsd_mount_count++;
460         obd->u.obt.obt_mount_count = lsd->lsd_mount_count;
461         obd->u.obt.obt_instance = (__u32)obd->u.obt.obt_mount_count;
462         ofd->ofd_subdir_count = lsd->lsd_subdir_count;
463
464         if (lsd->lsd_feature_incompat & ~OFD_INCOMPAT_SUPP) {
465                 CERROR("%s: unsupported incompat filesystem feature(s) %x\n",
466                        obd->obd_name,
467                        lsd->lsd_feature_incompat & ~OFD_INCOMPAT_SUPP);
468                 GOTO(err_fsd, rc = -EINVAL);
469         }
470         if (lsd->lsd_feature_rocompat & ~OFD_ROCOMPAT_SUPP) {
471                 CERROR("%s: unsupported read-only filesystem feature(s) %x\n",
472                        obd->obd_name,
473                        lsd->lsd_feature_rocompat & ~OFD_ROCOMPAT_SUPP);
474                 /* Do something like remount filesystem read-only */
475                 GOTO(err_fsd, rc = -EINVAL);
476         }
477
478         CDEBUG(D_INODE, "%s: server last_transno : "LPU64"\n",
479                obd->obd_name, lsd->lsd_last_transno);
480         CDEBUG(D_INODE, "%s: server mount_count: "LPU64"\n",
481                obd->obd_name, lsd->lsd_mount_count);
482         CDEBUG(D_INODE, "%s: server data size: %u\n",
483                obd->obd_name, lsd->lsd_server_size);
484         CDEBUG(D_INODE, "%s: per-client data start: %u\n",
485                obd->obd_name, lsd->lsd_client_start);
486         CDEBUG(D_INODE, "%s: per-client data size: %u\n",
487                obd->obd_name, lsd->lsd_client_size);
488         CDEBUG(D_INODE, "%s: server subdir_count: %u\n",
489                obd->obd_name, lsd->lsd_subdir_count);
490         CDEBUG(D_INODE, "%s: last_rcvd clients: %lu\n", obd->obd_name,
491                last_rcvd_size <= lsd->lsd_client_start ? 0 :
492                (last_rcvd_size - lsd->lsd_client_start) /
493                lsd->lsd_client_size);
494
495         if (!obd->obd_replayable)
496                 CWARN("%s: recovery support OFF\n", obd->obd_name);
497
498         rc = ofd_clients_data_init(env, ofd, last_rcvd_size);
499
500         spin_lock(&ofd->ofd_lut.lut_translock);
501         obd->obd_last_committed = lsd->lsd_last_transno;
502         ofd->ofd_lut.lut_last_transno = lsd->lsd_last_transno;
503         spin_unlock(&ofd->ofd_lut.lut_translock);
504
505         /* save it, so mount count and last_transno is current */
506         rc = tgt_server_data_update(env, &ofd->ofd_lut, 0);
507         if (rc)
508                 GOTO(err_fsd, rc);
509
510         RETURN(0);
511
512 err_fsd:
513         class_disconnect_exports(obd);
514         RETURN(rc);
515 }
516
517 int ofd_fs_setup(const struct lu_env *env, struct ofd_device *ofd,
518                  struct obd_device *obd)
519 {
520         struct ofd_thread_info  *info = ofd_info(env);
521         struct dt_object        *fo;
522         int                      rc = 0;
523
524         ENTRY;
525
526         if (OBD_FAIL_CHECK(OBD_FAIL_MDS_FS_SETUP))
527                 RETURN (-ENOENT);
528
529         /* prepare transactions callbacks */
530         ofd->ofd_txn_cb.dtc_txn_start = NULL;
531         ofd->ofd_txn_cb.dtc_txn_stop = ofd_txn_stop_cb;
532         ofd->ofd_txn_cb.dtc_txn_commit = NULL;
533         ofd->ofd_txn_cb.dtc_cookie = ofd;
534         ofd->ofd_txn_cb.dtc_tag = LCT_DT_THREAD;
535         CFS_INIT_LIST_HEAD(&ofd->ofd_txn_cb.dtc_linkage);
536
537         dt_txn_callback_add(ofd->ofd_osd, &ofd->ofd_txn_cb);
538
539         rc = ofd_server_data_init(env, ofd);
540         if (rc)
541                 GOTO(out, rc);
542
543         lu_local_obj_fid(&info->fti_fid, OFD_HEALTH_CHECK_OID);
544         memset(&info->fti_attr, 0, sizeof(info->fti_attr));
545         info->fti_attr.la_valid = LA_MODE;
546         info->fti_attr.la_mode = S_IFREG | S_IRUGO | S_IWUSR;
547         info->fti_dof.dof_type = dt_mode_to_dft(S_IFREG);
548
549         fo = dt_find_or_create(env, ofd->ofd_osd, &info->fti_fid,
550                                &info->fti_dof, &info->fti_attr);
551         if (IS_ERR(fo))
552                 GOTO(out, rc = PTR_ERR(fo));
553
554         ofd->ofd_health_check_file = fo;
555
556         rc = ofd_seqs_init(env, ofd);
557         if (rc)
558                 GOTO(out_hc, rc);
559
560         RETURN(0);
561 out_hc:
562         lu_object_put(env, &ofd->ofd_health_check_file->do_lu);
563 out:
564         dt_txn_callback_del(ofd->ofd_osd, &ofd->ofd_txn_cb);
565         return rc;
566 }
567
568 void ofd_fs_cleanup(const struct lu_env *env, struct ofd_device *ofd)
569 {
570         int i;
571
572         ENTRY;
573
574         ofd_info_init(env, NULL);
575
576         ofd_seqs_fini(env, ofd);
577
578         i = dt_sync(env, ofd->ofd_osd);
579         if (i)
580                 CERROR("can't sync: %d\n", i);
581
582         /* Remove transaction callback */
583         dt_txn_callback_del(ofd->ofd_osd, &ofd->ofd_txn_cb);
584
585         if (ofd->ofd_health_check_file) {
586                 lu_object_put(env, &ofd->ofd_health_check_file->do_lu);
587                 ofd->ofd_health_check_file = NULL;
588         }
589
590         EXIT;
591 }
592