~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to repair/dir.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2004-07-28 21:11:38 UTC
  • Revision ID: james.westby@ubuntu.com-20040728211138-0v4pdnunnp7na5lm
Tags: 2.6.20-1
* New upstream release.
* Fix xfs_io segfault on non-XFS files.  (closes: #260470)
* Fix packaging botch, deleted files included.  (closes: #260491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3
 
 * 
 
2
 * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of version 2 of the GNU General Public License as
6
6
 * published by the Free Software Foundation.
7
 
 * 
 
7
 *
8
8
 * This program is distributed in the hope that it would be useful, but
9
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 
 * 
 
11
 *
12
12
 * Further, this software is distributed without any warranty that it is
13
13
 * free of the rightful claim of any third person regarding infringement
14
14
 * or the like.  Any license provided herein, whether implied or
15
15
 * otherwise, applies only to this software file.  Patent licenses, if
16
16
 * any, provided herein do not apply to combinations of this program with
17
17
 * other software, or any other product whatsoever.
18
 
 * 
 
18
 *
19
19
 * You should have received a copy of the GNU General Public License along
20
20
 * with this program; if not, write the Free Software Foundation, Inc., 59
21
21
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22
 
 * 
 
22
 *
23
23
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
 * Mountain View, CA  94043, or:
25
 
 * 
26
 
 * http://www.sgi.com 
27
 
 * 
28
 
 * For further information regarding this notice, see: 
29
 
 * 
 
25
 *
 
26
 * http://www.sgi.com
 
27
 *
 
28
 * For further information regarding this notice, see:
 
29
 *
30
30
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31
31
 */
32
32
 
164
164
                        /*
165
165
                         * junk the entry, mark lino as NULL since it's bad
166
166
                         */
167
 
                        do_warn("invalid inode number %llu in directory %llu\n",
168
 
                                lino, ino);
 
167
                        do_warn(
 
168
        _("invalid inode number %llu in directory %llu\n"), lino, ino);
169
169
                        lino = NULLFSINO;
170
170
                        junkit = 1;
171
171
                } else if (lino == mp->m_sb.sb_rbmino)  {
172
172
                        do_warn(
173
 
        "entry in shorform dir %llu references realtime bitmap inode %llu\n",
 
173
        _("entry in shortform dir %llu references rt bitmap inode %llu\n"),
174
174
                                ino, lino);
175
175
                        junkit = 1;
176
176
                } else if (lino == mp->m_sb.sb_rsumino)  {
177
177
                        do_warn(
178
 
        "entry in shorform dir %llu references realtime summary inode %llu\n",
 
178
        _("entry in shortform dir %llu references rt summary inode %llu\n"),
179
179
                                ino, lino);
180
180
                        junkit = 1;
181
181
                } else if (lino == mp->m_sb.sb_uquotino)  {
182
182
                        do_warn(
183
 
        "entry in shorform dir %llu references user quota inode %llu\n",
 
183
        _("entry in shortform dir %llu references user quota inode %llu\n"),
184
184
                                ino, lino);
185
185
                        junkit = 1;
186
186
                } else if (lino == mp->m_sb.sb_gquotino)  {
187
187
                        do_warn(
188
 
        "entry in shorform dir %llu references group quota inode %llu\n",
 
188
        _("entry in shortform dir %llu references group quota inode %llu\n"),
189
189
                                ino, lino);
190
190
                        junkit = 1;
191
191
                } else if ((irec_p = find_inode_rec(XFS_INO_TO_AGNO(mp, lino),
205
205
 
206
206
                        if (!ino_discovery && is_inode_free(irec_p, ino_off))  {
207
207
                                do_warn(
208
 
        "entry references free inode %llu in shortform directory %llu\n",
 
208
        _("entry references free inode %llu in shortform directory %llu\n"),
209
209
                                        lino, ino);
210
210
                                junkit = 1;
211
211
                        }
224
224
                         * phase) so this is clearly a bogus entry.
225
225
                         */
226
226
                        do_warn(
227
 
        "entry references non-existent inode %llu in shortform dir %llu\n",
 
227
        _("entry references non-existent inode %llu in shortform dir %llu\n"),
228
228
                                        lino, ino);
229
229
                        junkit = 1;
230
230
                }
248
248
                                         (__psint_t) sf);
249
249
                                if (!no_modify)  {
250
250
                                        do_warn(
251
 
                "zero length entry in shortform dir %llu, resetting to %d\n",
 
251
                _("zero length entry in shortform dir %llu, resetting to %d\n"),
252
252
                                                ino, namelen);
253
253
                                        sf_entry->namelen = namelen;
254
254
                                } else  {
255
255
                                        do_warn(
256
 
                "zero length entry in shortform dir %llu, would set to %d\n",
 
256
                _("zero length entry in shortform dir %llu, would set to %d\n"),
257
257
                                                ino, namelen);
258
258
                                }
259
259
                        } else  {
260
260
                                do_warn(
261
 
        "zero length entry in shortform dir %llu",
 
261
                _("zero length entry in shortform dir %llu, "),
262
262
                                        ino);
263
263
                                if (!no_modify)
264
 
                                        do_warn(", junking %d entries\n",
 
264
                                        do_warn(_("junking %d entries\n"),
265
265
                                                num_entries - i);
266
266
                                else
267
 
                                        do_warn(", would junk %d entries\n",
 
267
                                        do_warn(_("would junk %d entries\n"),
268
268
                                                num_entries - i);
269
269
                                /*
270
270
                                 * don't process the rest of the directory,
282
282
                                        ((__psint_t) &sf_entry->name[0] -
283
283
                                         (__psint_t) sf);
284
284
                                do_warn(
285
 
        "size of last entry overflows space left in in shortform dir %llu, ",
 
285
        _("size of last entry overflows space left in in shortform dir %llu, "),
286
286
                                        ino);
287
287
                                if (!no_modify)  {
288
 
                                        do_warn("resetting to %d\n",
 
288
                                        do_warn(_("resetting to %d\n"),
289
289
                                                namelen);
290
290
                                        sf_entry->namelen = namelen;
291
291
                                        *dino_dirty = 1;
292
292
                                } else  {
293
 
                                        do_warn("would reset to %d\n",
 
293
                                        do_warn(_("would reset to %d\n"),
294
294
                                                namelen);
295
295
                                }
296
296
                        } else  {
297
297
                                do_warn(
298
 
        "size of entry #%d overflows space left in in shortform dir %llu\n",
 
298
        _("size of entry #%d overflows space left in in shortform dir %llu\n"),
299
299
                                        i, ino);
300
300
                                if (!no_modify)  {
301
301
                                        if (i == num_entries - 1)
302
 
                                                do_warn("junking entry #%d\n",
 
302
                                                do_warn(
 
303
                                                _("junking entry #%d\n"),
303
304
                                                        i);
304
305
                                        else
305
306
                                                do_warn(
306
 
                                                "junking %d entries\n",
 
307
                                                _("junking %d entries\n"),
307
308
                                                        num_entries - i);
308
309
                                } else  {
309
310
                                        if (i == num_entries - 1)
310
311
                                                do_warn(
311
 
                                                "would junk entry #%d\n",
 
312
                                                _("would junk entry #%d\n"),
312
313
                                                        i);
313
314
                                        else
314
315
                                                do_warn(
315
 
                                                "would junk %d entries\n",
 
316
                                                _("would junk %d entries\n"),
316
317
                                                        num_entries - i);
317
318
                                }
318
319
 
331
332
                         * junk entry
332
333
                         */
333
334
                        do_warn(
334
 
                "entry contains illegal character in shortform dir %llu\n",
 
335
                _("entry contains illegal character in shortform dir %llu\n"),
335
336
                                ino);
336
337
                        junkit = 1;
337
338
                }
352
353
 
353
354
                        if (!no_modify)  {
354
355
                                tmp_elen = XFS_DIR_SF_ENTSIZE_BYENTRY(sf_entry);
355
 
                                INT_MOD(dip->di_core.di_size, ARCH_CONVERT, -(tmp_elen));
 
356
                                INT_MOD(dip->di_core.di_size,
 
357
                                        ARCH_CONVERT, -(tmp_elen));
356
358
                                ino_dir_size -= tmp_elen;
357
359
 
358
360
                                tmp_sfe = (xfs_dir_sf_entry_t *)
385
387
                                *repair = 1;
386
388
 
387
389
                                do_warn(
388
 
                        "junking entry \"%s\" in directory inode %llu\n",
 
390
                _("junking entry \"%s\" in directory inode %llu\n"),
389
391
                                        name, ino);
390
392
                        } else  {
391
393
                                do_warn(
392
 
                "would have junked entry \"%s\" in directory inode %llu\n",
 
394
                _("would have junked entry \"%s\" in directory inode %llu\n"),
393
395
                                        name, ino);
394
396
                        }
395
397
                }
414
416
 
415
417
        if (INT_GET(sf->hdr.count, ARCH_CONVERT) != i)  {
416
418
                if (no_modify)  {
417
 
do_warn("would have corrected entry count in directory %llu from %d to %d\n",
 
419
                        do_warn(
 
420
        _("would have corrected entry count in directory %llu from %d to %d\n"),
418
421
                        ino, INT_GET(sf->hdr.count, ARCH_CONVERT), i);
419
422
                } else  {
420
 
do_warn("corrected entry count in directory %llu, was %d, now %d\n",
 
423
                        do_warn(
 
424
        _("corrected entry count in directory %llu, was %d, now %d\n"),
421
425
                        ino, INT_GET(sf->hdr.count, ARCH_CONVERT), i);
422
426
                        INT_SET(sf->hdr.count, ARCH_CONVERT, i);
423
427
                        *dino_dirty = 1;
428
432
        if ((__psint_t) next_sfe - (__psint_t) sf != ino_dir_size)  {
429
433
                if (no_modify)  {
430
434
                        do_warn(
431
 
                "would have corrected directory %llu size from %lld to %lld\n",
 
435
        _("would have corrected directory %llu size from %lld to %lld\n"),
432
436
                                ino, (__int64_t) ino_dir_size,
433
437
                        (__int64_t)((__psint_t) next_sfe - (__psint_t) sf));
434
438
                } else  {
435
439
                        do_warn(
436
 
                        "corrected directory %llu size, was %lld, now %lld\n",
 
440
        _("corrected directory %llu size, was %lld, now %lld\n"),
437
441
                                ino, (__int64_t) ino_dir_size,
438
442
                        (__int64_t)((__psint_t) next_sfe - (__psint_t) sf));
439
443
 
440
 
                        INT_SET(dip->di_core.di_size, ARCH_CONVERT, (xfs_fsize_t)
441
 
                                        ((__psint_t) next_sfe - (__psint_t) sf));
 
444
                        INT_SET(dip->di_core.di_size,
 
445
                                ARCH_CONVERT, (xfs_fsize_t)
 
446
                                ((__psint_t) next_sfe - (__psint_t) sf));
442
447
                        *dino_dirty = 1;
443
448
                        *repair = 1;
444
449
                }
455
460
                *parent = NULLFSINO;
456
461
 
457
462
                do_warn(
458
 
        "bogus .. inode number (%llu) in directory inode %llu,",
 
463
        _("bogus .. inode number (%llu) in directory inode %llu, "),
459
464
                                *parent, ino);
460
465
                if (!no_modify)  {
461
 
                        do_warn("clearing inode number\n");
 
466
                        do_warn(_("clearing inode number\n"));
462
467
 
463
 
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent, &sf->hdr.parent, ARCH_CONVERT);
 
468
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent,
 
469
                                        &sf->hdr.parent, ARCH_CONVERT);
464
470
                        *dino_dirty = 1;
465
471
                        *repair = 1;
466
472
                } else  {
467
 
                        do_warn("would clear inode number\n");
 
473
                        do_warn(_("would clear inode number\n"));
468
474
                }
469
475
        } else if (ino == mp->m_sb.sb_rootino && ino != *parent) {
470
476
                /*
472
478
                 */
473
479
                if (!no_modify)  {
474
480
                        do_warn(
475
 
        "corrected root directory %llu .. entry, was %llu, now %llu\n",
 
481
        _("corrected root directory %llu .. entry, was %llu, now %llu\n"),
476
482
                                ino, *parent, ino);
477
483
                        *parent = ino;
478
 
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent, &sf->hdr.parent, ARCH_CONVERT);
 
484
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent,
 
485
                                        &sf->hdr.parent, ARCH_CONVERT);
479
486
                        *dino_dirty = 1;
480
487
                        *repair = 1;
481
488
                } else  {
482
489
                        do_warn(
483
 
        "would have corrected root directory %llu .. entry from %llu to %llu\n",
 
490
        _("would have corrected root directory %llu .. entry from %llu to %llu\n"),
484
491
                                ino, *parent, ino);
485
492
                }
486
493
        } else if (ino == *parent && ino != mp->m_sb.sb_rootino)  {
489
496
                 * to .
490
497
                 */
491
498
                *parent = NULLFSINO;
492
 
                do_warn("bad .. entry in dir ino %llu, points to self,",
 
499
                do_warn(_("bad .. entry in dir ino %llu, points to self, "),
493
500
                        ino);
494
501
                if (!no_modify)  {
495
 
                        do_warn(" clearing inode number\n");
 
502
                        do_warn(_("clearing inode number\n"));
496
503
 
497
 
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent, &sf->hdr.parent, ARCH_CONVERT);
 
504
                        XFS_DIR_SF_PUT_DIRINO_ARCH(parent,
 
505
                                        &sf->hdr.parent, ARCH_CONVERT);
498
506
                        *dino_dirty = 1;
499
507
                        *repair = 1;
500
508
                } else  {
501
 
                        do_warn(" would clear inode number\n");
 
509
                        do_warn(_("would clear inode number\n"));
502
510
                }
503
511
        }
504
512
 
552
560
                /*
553
561
                 * allow == relation since [x, x) claims 1 byte
554
562
                 */
555
 
                do_warn("bad range claimed [%d, %d) in da block\n",
 
563
                do_warn(_("bad range claimed [%d, %d) in da block\n"),
556
564
                        start, stop);
557
565
                return(1);
558
566
        }
559
567
 
560
568
        if (stop > mp->m_sb.sb_blocksize)  {
561
569
                do_warn(
562
 
                "byte range end [%d %d) in da block larger than blocksize %d\n",
 
570
        _("byte range end [%d %d) in da block larger than blocksize %d\n"),
563
571
                        start, stop, mp->m_sb.sb_blocksize);
564
572
                return(1);
565
573
        }
566
574
 
567
575
        for (i = start; i < stop; i ++)  {
568
576
                if (map[i / NBBY] & (mask << i % NBBY))  {
569
 
                        do_warn("multiply claimed byte %d in da block\n", i);
 
577
                        do_warn(_("multiply claimed byte %d in da block\n"), i);
570
578
                        return(1);
571
579
                }
572
580
                map[i / NBBY] |= (mask << i % NBBY);
589
597
        for (i = 0; i < XFS_DIR_LEAF_MAPSIZE; i++)  {
590
598
                if (holes->hentries[i].size == 0)
591
599
                        continue;
592
 
                
 
600
 
593
601
                start = holes->hentries[i].base;
594
602
                len = holes->hentries[i].size;
595
603
 
596
604
                if (start >= mp->m_sb.sb_blocksize ||
597
605
                                start + len > mp->m_sb.sb_blocksize)  {
598
606
                        do_warn(
599
 
        "hole (start %d, len %d) out of range, block %d, dir ino %llu\n",
 
607
        _("hole (start %d, len %d) out of range, block %d, dir ino %llu\n"),
600
608
                                start, len, da_bno, ino);
601
609
                        return(1);
602
610
                }
607
615
                                 * bad news -- hole claims a used byte is free
608
616
                                 */
609
617
                                do_warn(
610
 
                "hole claims used byte %d, block %d, dir ino %llu\n",
 
618
                        _("hole claims used byte %d, block %d, dir ino %llu\n"),
611
619
                                        j, da_bno, ino);
612
620
                                return(1);
613
621
                        }
722
730
        if ((holemap->lost_holes > 0 ? 1 : 0) != block_hmap->lost_holes)  {
723
731
                if (verbose)  {
724
732
                        do_warn(
725
 
                "- derived hole value %d, saw %d, block %d, dir ino %llu\n",
 
733
                _("- derived hole value %d, saw %d, block %d, dir ino %llu\n"),
726
734
                                holemap->lost_holes, block_hmap->lost_holes,
727
735
                                da_bno, ino);
728
736
                        res = 1;
735
743
                        if (holemap->hentries[i].base ==
736
744
                                        block_hmap->hentries[k].base
737
745
                                        && holemap->hentries[i].size ==
738
 
                                        block_hmap->hentries[k].size)  
 
746
                                        block_hmap->hentries[k].size)
739
747
                                found = 1;
740
748
                }
741
749
                if (!found)  {
742
750
                        if (verbose)  {
743
751
                                do_warn(
744
 
"- derived hole (base %d, size %d) in block %d, dir inode %llu not found\n",
 
752
_("- derived hole (base %d, size %d) in block %d, dir inode %llu not found\n"),
745
753
                                        holemap->hentries[i].base,
746
754
                                        holemap->hentries[i].size,
747
755
                                        da_bno, ino);
786
794
traverse_int_dablock(xfs_mount_t        *mp,
787
795
                da_bt_cursor_t          *da_cursor,
788
796
                xfs_dablk_t             *rbno,
789
 
                int                     whichfork)
 
797
                int                     whichfork)
790
798
{
791
799
        xfs_dablk_t             bno;
792
800
        int                     i;
817
825
                                XFS_FSB_TO_BB(mp, 1), 0);
818
826
                if (!bp) {
819
827
                        if (whichfork == XFS_DATA_FORK)
820
 
                                do_warn("can't read block %u (fsbno %llu) for "
821
 
                                        "directory inode %llu\n",
 
828
                                do_warn(_("can't read block %u (fsbno %llu) "
 
829
                                        "for directory inode %llu\n"),
822
830
                                        bno, fsbno, da_cursor->ino);
823
831
                        else
824
 
                                do_warn("can't read block %u (fsbno %llu) for "
825
 
                                        "attrbute fork of inode %llu\n",
 
832
                                do_warn(_("can't read block %u (fsbno %llu) "
 
833
                                        "for attrbute fork of inode %llu\n"),
826
834
                                        bno, fsbno, da_cursor->ino);
827
835
                        goto error_out;
828
836
                }
830
838
                node = (xfs_da_intnode_t *)XFS_BUF_PTR(bp);
831
839
 
832
840
                if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) != XFS_DA_NODE_MAGIC)  {
833
 
                        do_warn("bad dir/attr magic number in inode %llu, file "
834
 
                                "bno = %u, fsbno = %llu\n", da_cursor->ino, bno, fsbno);
 
841
                        do_warn(_("bad dir/attr magic number in inode %llu, "
 
842
                                  "file bno = %u, fsbno = %llu\n"),
 
843
                                da_cursor->ino, bno, fsbno);
835
844
                        libxfs_putbuf(bp);
836
845
                        goto error_out;
837
846
                }
838
 
                if (INT_GET(node->hdr.count, ARCH_CONVERT) > XFS_DA_NODE_ENTRIES(mp))  {
839
 
                        do_warn("bad record count in inode %llu, count = %d, max = %d\n",
840
 
                                da_cursor->ino, INT_GET(node->hdr.count, ARCH_CONVERT),
841
 
                                XFS_DA_NODE_ENTRIES(mp));
 
847
                if (INT_GET(node->hdr.count, ARCH_CONVERT) >
 
848
                                                mp->m_dir_node_ents)  {
 
849
                        do_warn(_("bad record count in inode %llu, "
 
850
                                  "count = %d, max = %d\n"),
 
851
                                da_cursor->ino,
 
852
                                INT_GET(node->hdr.count, ARCH_CONVERT),
 
853
                                mp->m_dir_node_ents);
842
854
                        libxfs_putbuf(bp);
843
855
                        goto error_out;
844
856
                }
852
864
                        if (INT_GET(node->hdr.level, ARCH_CONVERT) == i - 1)  {
853
865
                                i--;
854
866
                        } else  {
855
 
                                if (whichfork == XFS_DATA_FORK) 
856
 
                                        do_warn("bad directory btree for directory "
857
 
                                                "inode %llu\n", da_cursor->ino);
 
867
                                if (whichfork == XFS_DATA_FORK)
 
868
                                        do_warn(_("bad directory btree for "
 
869
                                                  "directory inode %llu\n"),
 
870
                                                da_cursor->ino);
858
871
                                else
859
 
                                        do_warn("bad attribute fork btree for "
860
 
                                                "inode %llu\n", da_cursor->ino);
 
872
                                        do_warn(_("bad attribute fork btree "
 
873
                                                  "for inode %llu\n"),
 
874
                                                da_cursor->ino);
861
875
                                libxfs_putbuf(bp);
862
876
                                goto error_out;
863
877
                        }
909
923
 
910
924
        if (cursor->level[level].bp != NULL)  {
911
925
                if (!error)  {
912
 
                        do_warn("release_da_cursor_int got unexpected non-null bp, "
913
 
                                "dabno = %u\n", cursor->level[level].bno);
 
926
                        do_warn(_("release_da_cursor_int got unexpected "
 
927
                                  "non-null bp, dabno = %u\n"),
 
928
                                cursor->level[level].bno);
914
929
                }
915
930
                ASSERT(error != 0);
916
931
 
969
984
        fsbno = get_bmapi(mp, dino, ino, bno, XFS_DATA_FORK);
970
985
 
971
986
        if (fsbno == NULLDFSBNO)  {
972
 
                do_warn("bmap of block #%u of inode %llu failed\n",
 
987
                do_warn(_("bmap of block #%u of inode %llu failed\n"),
973
988
                        bno, ino);
974
989
                return(fsbno);
975
990
        }
982
997
                 * walk down left side of btree, release buffers as you
983
998
                 * go.  if the root block is a leaf (single-level btree),
984
999
                 * just return it.
985
 
                 * 
 
1000
                 *
986
1001
                 */
987
1002
 
988
1003
                bp = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, fsbno),
989
1004
                                XFS_FSB_TO_BB(mp, 1), 0);
990
1005
                if (!bp) {
991
 
                        do_warn("can't read block %u (fsbno %llu) for directory "
992
 
                                "inode %llu\n", bno, fsbno, ino);
 
1006
                        do_warn(_("can't read block %u (fsbno %llu) "
 
1007
                                  "for directory inode %llu\n"),
 
1008
                                bno, fsbno, ino);
993
1009
                        return(NULLDFSBNO);
994
1010
                }
995
1011
 
996
1012
                node = (xfs_da_intnode_t *)XFS_BUF_PTR(bp);
997
1013
 
998
 
                if (INT_GET(node->hdr.info.magic, ARCH_CONVERT) != XFS_DA_NODE_MAGIC)  {
999
 
                        do_warn("bad dir/attr magic number in inode %llu, file "
1000
 
                                "bno = %u, fsbno = %llu\n", ino, bno, fsbno);
 
1014
                if (XFS_DA_NODE_MAGIC !=
 
1015
                    INT_GET(node->hdr.info.magic, ARCH_CONVERT))  {
 
1016
                        do_warn(_("bad dir/attr magic number in inode %llu, "
 
1017
                                  "file bno = %u, fsbno = %llu\n"),
 
1018
                                ino, bno, fsbno);
1001
1019
                        libxfs_putbuf(bp);
1002
1020
                        return(NULLDFSBNO);
1003
1021
                }
1011
1029
                fsbno = get_bmapi(mp, dino, ino, bno, XFS_DATA_FORK);
1012
1030
 
1013
1031
                if (fsbno == NULLDFSBNO)  {
1014
 
                        do_warn("bmap of block #%u of inode %llu failed\n", bno, ino);
 
1032
                        do_warn(_("bmap of block #%u of inode %llu failed\n"),
 
1033
                                bno, ino);
1015
1034
                        return(NULLDFSBNO);
1016
1035
                }
1017
1036
 
1035
1054
                const int               p_level)
1036
1055
{
1037
1056
        xfs_da_intnode_t        *node;
 
1057
        xfs_dahash_t            hashval;
1038
1058
        int                     bad = 0;
1039
1059
        int                     entry;
1040
1060
        int                     this_level = p_level + 1;
1055
1075
         * match, etc.
1056
1076
         */
1057
1077
        if (entry != INT_GET(node->hdr.count, ARCH_CONVERT) - 1)  {
1058
 
                do_warn("directory/attribute block used/count inconsistency - %d/%hu\n",
 
1078
                do_warn(_("directory/attribute block used/count "
 
1079
                          "inconsistency - %d/%hu\n"),
1059
1080
                        entry, INT_GET(node->hdr.count, ARCH_CONVERT));
1060
1081
                bad++;
1061
1082
        }
1063
1084
         * hash values monotonically increasing ???
1064
1085
         */
1065
1086
        if (cursor->level[this_level].hashval >=
1066
 
                                INT_GET(node->btree[entry].hashval, ARCH_CONVERT)) {
1067
 
                do_warn("directory/attribute block hashvalue inconsistency, "
1068
 
                        "expected > %u / saw %u\n", cursor->level[this_level].hashval,
 
1087
            INT_GET(node->btree[entry].hashval, ARCH_CONVERT)) {
 
1088
                do_warn(_("directory/attribute block hashvalue inconsistency, "
 
1089
                          "expected > %u / saw %u\n"),
 
1090
                        cursor->level[this_level].hashval,
1069
1091
                        INT_GET(node->btree[entry].hashval, ARCH_CONVERT));
1070
1092
                bad++;
1071
1093
        }
1072
1094
        if (INT_GET(node->hdr.info.forw, ARCH_CONVERT) != 0)  {
1073
 
                do_warn("bad directory/attribute forward block pointer, expected 0, "
1074
 
                        "saw %u\n", INT_GET(node->hdr.info.forw, ARCH_CONVERT));
 
1095
                do_warn(_("bad directory/attribute forward block pointer, "
 
1096
                          "expected 0, saw %u\n"),
 
1097
                        INT_GET(node->hdr.info.forw, ARCH_CONVERT));
1075
1098
                bad++;
1076
1099
        }
1077
1100
        if (bad) {
1078
 
                do_warn("bad directory block in dir ino %llu\n", cursor->ino);
 
1101
                do_warn(_("bad directory block in dir ino %llu\n"),
 
1102
                        cursor->ino);
1079
1103
                return(1);
1080
1104
        }
1081
1105
        /*
1089
1113
         * ok, now check descendant block number against this level
1090
1114
         */
1091
1115
        if (cursor->level[p_level].bno !=
1092
 
                        INT_GET(node->btree[entry].before, ARCH_CONVERT))  {
 
1116
            INT_GET(node->btree[entry].before, ARCH_CONVERT))  {
1093
1117
#ifdef XR_DIR_TRACE
1094
 
                fprintf(stderr, "bad directory btree pointer, child bno should be %d, "
1095
 
                        "block bno is %d, hashval is %u\n",
 
1118
                fprintf(stderr, "bad directory btree pointer, child bno should "
 
1119
                                "be %d, block bno is %d, hashval is %u\n",
1096
1120
                        INT_GET(node->btree[entry].before, ARCH_CONVERT),
1097
1121
                        cursor->level[p_level].bno,
1098
1122
                        cursor->level[p_level].hashval);
1102
1126
        }
1103
1127
 
1104
1128
        if (cursor->level[p_level].hashval !=
1105
 
                                INT_GET(node->btree[entry].hashval, ARCH_CONVERT)) {
 
1129
            INT_GET(node->btree[entry].hashval, ARCH_CONVERT)) {
1106
1130
                if (!no_modify)  {
1107
 
                        do_warn("correcting bad hashval in non-leaf dir/attr block\n");
1108
 
                        do_warn("\tin (level %d) in inode %llu.\n",
 
1131
                        do_warn(_("correcting bad hashval in non-leaf "
 
1132
                                  "dir/attr block\n\tin (level %d) in "
 
1133
                                  "inode %llu.\n"),
1109
1134
                                this_level, cursor->ino);
1110
1135
                        INT_SET(node->btree[entry].hashval, ARCH_CONVERT,
1111
1136
                                cursor->level[p_level].hashval);
1112
1137
                        cursor->level[this_level].dirty++;
1113
1138
                } else  {
1114
 
                        do_warn("would correct bad hashval in non-leaf dir/attr "
1115
 
                                "block\n\tin (level %d) in inode %llu.\n",
 
1139
                        do_warn(_("would correct bad hashval in non-leaf "
 
1140
                                  "dir/attr block\n\tin (level %d) in "
 
1141
                                  "inode %llu.\n"),
1116
1142
                                this_level, cursor->ino);
1117
1143
                }
1118
1144
        }
1119
1145
 
1120
1146
        /*
 
1147
         * Note: squirrel hashval away _before_ releasing the
 
1148
         * buffer, preventing a use-after-free problem.
 
1149
         */
 
1150
        hashval = INT_GET(node->btree[entry].hashval, ARCH_CONVERT);
 
1151
 
 
1152
        /*
1121
1153
         * release/write buffer
1122
1154
         */
1123
1155
        ASSERT(cursor->level[this_level].dirty == 0 ||
1140
1172
                return(0);
1141
1173
        }
1142
1174
        /*
1143
 
         * set hashvalue to correctl reflect the now-validated
 
1175
         * set hashvalue to correctly reflect the now-validated
1144
1176
         * last entry in this block and continue upwards validation
1145
1177
         */
1146
 
        cursor->level[this_level].hashval =
1147
 
                        INT_GET(node->btree[entry].hashval, ARCH_CONVERT);
 
1178
        cursor->level[this_level].hashval = hashval;
1148
1179
        return(verify_final_da_path(mp, cursor, this_level));
1149
1180
}
1150
1181
 
1219
1250
                 * validating it.  bno value should be ok since
1220
1251
                 * it was set when the block was first read in.
1221
1252
                 */
1222
 
                cursor->level[this_level].hashval = 
 
1253
                cursor->level[this_level].hashval =
1223
1254
                                INT_GET(node->btree[entry - 1].hashval, ARCH_CONVERT);
1224
1255
 
1225
1256
                /*
1243
1274
                fsbno = blkmap_get(cursor->blkmap, dabno);
1244
1275
 
1245
1276
                if (fsbno == NULLDFSBNO) {
1246
 
                        do_warn("can't get map info for block %u of directory "
1247
 
                                "inode %llu\n", dabno, cursor->ino);
 
1277
                        do_warn(_("can't get map info for block %u "
 
1278
                                  "of directory inode %llu\n"),
 
1279
                                dabno, cursor->ino);
1248
1280
                        return(1);
1249
1281
                }
1250
1282
 
1251
1283
                bp = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, fsbno),
1252
1284
                                XFS_FSB_TO_BB(mp, 1), 0);
1253
1285
                if (!bp) {
1254
 
                        do_warn("can't read block %u (%llu) for directory inode %llu\n",
 
1286
                        do_warn(_("can't read block %u (%llu) "
 
1287
                                  "for directory inode %llu\n"),
1255
1288
                                dabno, fsbno, cursor->ino);
1256
1289
                        return(1);
1257
1290
                }
1262
1295
                 * entry count, verify level
1263
1296
                 */
1264
1297
                bad = 0;
1265
 
                if (INT_GET(newnode->hdr.info.magic, ARCH_CONVERT) != XFS_DA_NODE_MAGIC)  {
1266
 
                        do_warn("bad magic number %x in block %u (%llu) for directory "
1267
 
                                "inode %llu\n",
 
1298
                if (XFS_DA_NODE_MAGIC !=
 
1299
                    INT_GET(newnode->hdr.info.magic, ARCH_CONVERT))  {
 
1300
                        do_warn(_("bad magic number %x in block %u (%llu) "
 
1301
                                  "for directory inode %llu\n"),
1268
1302
                                INT_GET(newnode->hdr.info.magic, ARCH_CONVERT),
1269
1303
                                dabno, fsbno, cursor->ino);
1270
1304
                        bad++;
1271
1305
                }
1272
1306
                if (INT_GET(newnode->hdr.info.back, ARCH_CONVERT) !=
1273
 
                                                cursor->level[this_level].bno)  {
1274
 
                        do_warn("bad back pointer in block %u (%llu) for directory "
1275
 
                                "inode %llu\n", dabno, fsbno, cursor->ino);
 
1307
                    cursor->level[this_level].bno)  {
 
1308
                        do_warn(_("bad back pointer in block %u (%llu) "
 
1309
                                  "for directory inode %llu\n"),
 
1310
                                dabno, fsbno, cursor->ino);
1276
1311
                        bad++;
1277
1312
                }
1278
1313
                if (INT_GET(newnode->hdr.count, ARCH_CONVERT) >
1279
 
                                                XFS_DA_NODE_ENTRIES(mp))  {
1280
 
                        do_warn("entry count %d too large in block %u (%llu) for "
1281
 
                                "directory inode %llu\n",
 
1314
                    mp->m_dir_node_ents)  {
 
1315
                        do_warn(_("entry count %d too large in block %u (%llu) "
 
1316
                                  "for directory inode %llu\n"),
1282
1317
                                INT_GET(newnode->hdr.count, ARCH_CONVERT),
1283
1318
                                dabno, fsbno, cursor->ino);
1284
1319
                        bad++;
1285
1320
                }
1286
1321
                if (INT_GET(newnode->hdr.level, ARCH_CONVERT) != this_level)  {
1287
 
                        do_warn("bad level %d in block %u (%llu) for directory inode "
1288
 
                                "%llu\n", INT_GET(newnode->hdr.level, ARCH_CONVERT),
 
1322
                        do_warn(_("bad level %d in block %u (%llu) "
 
1323
                                  "for directory inode %llu\n"),
 
1324
                                INT_GET(newnode->hdr.level, ARCH_CONVERT),
1289
1325
                                dabno, fsbno, cursor->ino);
1290
1326
                        bad++;
1291
1327
                }
1325
1361
        if (cursor->level[p_level].bno !=
1326
1362
                        INT_GET(node->btree[entry].before, ARCH_CONVERT))  {
1327
1363
#ifdef XR_DIR_TRACE
1328
 
                fprintf(stderr, "bad directory btree pointer, child bno should be %d, "
1329
 
                        "block bno is %d, hashval is %u\n",
 
1364
                fprintf(stderr, "bad directory btree pointer, child bno "
 
1365
                        "should be %d, block bno is %d, hashval is %u\n",
1330
1366
                        INT_GET(node->btree[entry].before, ARCH_CONVERT),
1331
1367
                        cursor->level[p_level].bno,
1332
1368
                        cursor->level[p_level].hashval);
1341
1377
        if (cursor->level[p_level].hashval !=
1342
1378
                        INT_GET(node->btree[entry].hashval, ARCH_CONVERT))  {
1343
1379
                if (!no_modify)  {
1344
 
                        do_warn("correcting bad hashval in interior dir/attr block\n");
1345
 
                        do_warn("\tin (level %d) in inode %llu.\n",
 
1380
                        do_warn(_("correcting bad hashval in interior "
 
1381
                                  "dir/attr block\n\tin (level %d) in "
 
1382
                                  "inode %llu.\n"),
1346
1383
                                this_level, cursor->ino);
1347
1384
                        INT_SET(node->btree[entry].hashval, ARCH_CONVERT,
1348
1385
                                cursor->level[p_level].hashval);
1349
1386
                        cursor->level[this_level].dirty++;
1350
1387
                } else  {
1351
 
                        do_warn("would correct bad hashval in interior dir/attr "
1352
 
                                "block\n\tin (level %d) in inode %llu.\n",
 
1388
                        do_warn(_("would correct bad hashval in interior "
 
1389
                                  "dir/attr block\n\tin (level %d) in "
 
1390
                                  "inode %llu.\n"),
1353
1391
                                this_level, cursor->ino);
1354
1392
                }
1355
1393
        }
1467
1505
                if (current_hole < XFS_DIR_LEAF_MAPSIZE)  {
1468
1506
                        ASSERT(sizeof(xfs_dir_leaf_name_t) <= bytes);
1469
1507
 
1470
 
                        do_warn("marking bad entry in directory inode %llu\n",
 
1508
                        do_warn(_("marking bad entry in directory inode %llu\n"),
1471
1509
                                ino);
1472
1510
 
1473
1511
                        entry->namelen = 1;
1493
1531
                         */
1494
1532
                        INT_MOD(hdr->count, ARCH_CONVERT, -1);
1495
1533
                        do_warn(
1496
 
                        "deleting zero length entry in directory inode %llu\n",
 
1534
                _("deleting zero length entry in directory inode %llu\n"),
1497
1535
                                ino);
1498
1536
                        /*
1499
1537
                         * overwrite the bad entry unless it's the
1592
1630
                                 * a bad entry
1593
1631
                                 */
1594
1632
                                do_warn(
1595
 
                                "deleting entry in directory inode %llu\n",
 
1633
                                _("deleting entry in directory inode %llu\n"),
1596
1634
                                        ino);
1597
1635
                                /*
1598
1636
                                 * overwrite the bad entry unless it's the
1685
1723
        xfs_mount_t             *mp,
1686
1724
        xfs_dir_leafblock_t     *leaf,
1687
1725
        xfs_dablk_t             da_bno,
1688
 
        xfs_ino_t               ino, 
 
1726
        xfs_ino_t               ino,
1689
1727
        xfs_dahash_t            last_hashval,   /* last hashval encountered */
1690
1728
        int                     ino_discovery,
1691
1729
        blkmap_t                *blkmap,
1741
1779
         */
1742
1780
 
1743
1781
        if ((dir_freemap = alloc_da_freemap(mp)) == NULL)  {
1744
 
                do_error("couldn't allocate directory block freemap\n");
 
1782
                do_error(_("couldn't allocate directory block freemap\n"));
1745
1783
                abort();
1746
1784
        }
1747
1785
#endif
1754
1792
        i = stop = sizeof(xfs_dir_leaf_hdr_t);
1755
1793
        if (set_da_freemap(mp, dir_freemap, 0, stop))  {
1756
1794
                do_warn(
1757
 
"directory block header conflicts with used space in directory inode %llu\n",
1758
 
                                ino);
 
1795
_("directory block header conflicts with used space in directory inode %llu\n"),
 
1796
                        ino);
1759
1797
                return(1);
1760
1798
        }
1761
1799
 
1776
1814
                 * if it is, delete the entry since we can't
1777
1815
                 * grab the inode #.
1778
1816
                 */
1779
 
                if (INT_GET(entry->nameidx, ARCH_CONVERT) >= mp->m_sb.sb_blocksize)  {
 
1817
                if (INT_GET(entry->nameidx, ARCH_CONVERT) >=
 
1818
                    mp->m_sb.sb_blocksize)  {
1780
1819
                        if (!no_modify)  {
1781
1820
                                *buf_dirty = 1;
1782
1821
 
1783
1822
                                if (INT_GET(leaf->hdr.count, ARCH_CONVERT) > 1)  {
1784
1823
                                        do_warn(
1785
 
"nameidx %d for entry #%d, bno %d, ino %llu > fs blocksize, deleting entry\n",
1786
 
                                                INT_GET(entry->nameidx, ARCH_CONVERT), i, da_bno, ino);
1787
 
                                        ASSERT(INT_GET(leaf->hdr.count, ARCH_CONVERT) > i);
 
1824
_("nameidx %d for entry #%d, bno %d, ino %llu > fs blocksize, deleting entry\n"),
 
1825
                                                INT_GET(entry->nameidx,
 
1826
                                                        ARCH_CONVERT),
 
1827
                                                i, da_bno, ino);
 
1828
                                        ASSERT(INT_GET(leaf->hdr.count,
 
1829
                                                        ARCH_CONVERT) > i);
1788
1830
 
1789
 
                                        bytes = (INT_GET(leaf->hdr.count, ARCH_CONVERT) - i) *
 
1831
                                        bytes = (INT_GET(leaf->hdr.count,
 
1832
                                                        ARCH_CONVERT) - i) *
1790
1833
                                                sizeof(xfs_dir_leaf_entry_t);
1791
1834
 
1792
1835
                                        /*
1818
1861
                                        entry--;
1819
1862
                                } else  {
1820
1863
                                        do_warn(
1821
 
"nameidx %d, entry #%d, bno %d, ino %llu > fs blocksize, marking entry bad\n",
1822
 
                                                INT_GET(entry->nameidx, ARCH_CONVERT), i, da_bno, ino);
1823
 
                                        INT_SET(entry->nameidx, ARCH_CONVERT, mp->m_sb.sb_blocksize -
 
1864
_("nameidx %d, entry #%d, bno %d, ino %llu > fs blocksize, marking entry bad\n"),
 
1865
                                                INT_GET(entry->nameidx,
 
1866
                                                        ARCH_CONVERT),
 
1867
                                                i, da_bno, ino);
 
1868
                                        INT_SET(entry->nameidx, ARCH_CONVERT,
 
1869
                                                mp->m_sb.sb_blocksize -
1824
1870
                                                sizeof(xfs_dir_leaf_name_t));
1825
1871
                                        namest = XFS_DIR_LEAF_NAMESTRUCT(leaf,
1826
 
                                                        INT_GET(entry->nameidx, ARCH_CONVERT));
 
1872
                                                        INT_GET(entry->nameidx,
 
1873
                                                                ARCH_CONVERT));
1827
1874
                                        lino = NULLFSINO;
1828
1875
                                        XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
1829
 
                                                        &namest->inumber, ARCH_CONVERT);
 
1876
                                                &namest->inumber, ARCH_CONVERT);
1830
1877
                                        namest->name[0] = '/';
1831
1878
                                }
1832
1879
                        } else  {
1833
1880
                                do_warn(
1834
 
"nameidx %d, entry #%d, bno %d, ino %llu > fs blocksize, would delete entry\n",
1835
 
                                        INT_GET(entry->nameidx, ARCH_CONVERT), i, da_bno, ino);
 
1881
_("nameidx %d, entry #%d, bno %d, ino %llu > fs blocksize, would delete entry\n"),
 
1882
                                        INT_GET(entry->nameidx, ARCH_CONVERT),
 
1883
                                        i, da_bno, ino);
1836
1884
                        }
1837
1885
                        continue;
1838
1886
                }
1843
1891
                 * we can still try for the inode as long as nameidx
1844
1892
                 * is ok.
1845
1893
                 */
1846
 
                namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT));
 
1894
                namest = XFS_DIR_LEAF_NAMESTRUCT(leaf,
 
1895
                                INT_GET(entry->nameidx, ARCH_CONVERT));
1847
1896
                XFS_DIR_SF_GET_DIRINO_ARCH(&namest->inumber, &lino, ARCH_CONVERT);
1848
1897
 
1849
1898
                /*
1866
1915
                         * since it's still structurally intact.
1867
1916
                         */
1868
1917
                        do_warn(
1869
 
"invalid ino number %llu in dir ino %llu, entry #%d, bno %d\n",
 
1918
        _("invalid ino number %llu in dir ino %llu, entry #%d, bno %d\n"),
1870
1919
                                lino, ino, i, da_bno);
1871
1920
                        if (!no_modify)  {
1872
1921
                                do_warn(
1873
 
                                "\tclearing ino number in entry %d...\n", i);
1874
 
 
 
1922
                                _("\tclearing ino number in entry %d...\n"),
 
1923
                                        i);
1875
1924
                                lino = NULLFSINO;
1876
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
1925
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
1926
                                        &namest->inumber, ARCH_CONVERT);
1877
1927
                                *buf_dirty = 1;
1878
1928
                        } else  {
1879
1929
                                do_warn(
1880
 
                                "\twould clear ino number in entry %d...\n", i);
 
1930
                                _("\twould clear ino number in entry %d...\n"),
 
1931
                                        i);
1881
1932
                        }
1882
1933
                } else if (lino == mp->m_sb.sb_rbmino)  {
1883
1934
                        do_warn(
1884
 
"entry #%d, bno %d in directory %llu references realtime bitmap inode %llu\n",
 
1935
_("entry #%d, bno %d in directory %llu references realtime bitmap inode %llu\n"),
1885
1936
                                i, da_bno, ino, lino);
1886
1937
                        if (!no_modify)  {
1887
1938
                                do_warn(
1888
 
                                "\tclearing ino number in entry %d...\n", i);
 
1939
                                _("\tclearing ino number in entry %d...\n"),
 
1940
                                        i);
1889
1941
 
1890
1942
                                lino = NULLFSINO;
1891
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
1943
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
1944
                                        &namest->inumber, ARCH_CONVERT);
1892
1945
                                *buf_dirty = 1;
1893
1946
                        } else  {
1894
1947
                                do_warn(
1895
 
                                "\twould clear ino number in entry %d...\n", i);
 
1948
                                _("\twould clear ino number in entry %d...\n"),
 
1949
                                        i);
1896
1950
                        }
1897
1951
                } else if (lino == mp->m_sb.sb_rsumino)  {
1898
1952
                        do_warn(
1899
 
"entry #%d, bno %d in directory %llu references realtime summary inode %llu\n",
 
1953
_("entry #%d, bno %d in directory %llu references realtime summary inode %llu\n"),
1900
1954
                                i, da_bno, ino, lino);
1901
1955
                        if (!no_modify)  {
1902
1956
                                do_warn(
1903
 
                                "\tclearing ino number in entry %d...\n", i);
 
1957
                                _("\tclearing ino number in entry %d...\n"), i);
1904
1958
 
1905
1959
                                lino = NULLFSINO;
1906
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
1960
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
1961
                                        &namest->inumber, ARCH_CONVERT);
1907
1962
                                *buf_dirty = 1;
1908
1963
                        } else  {
1909
1964
                                do_warn(
1910
 
                                "\twould clear ino number in entry %d...\n", i);
 
1965
                                _("\twould clear ino number in entry %d...\n"),
 
1966
                                        i);
1911
1967
                        }
1912
1968
                } else if (lino == mp->m_sb.sb_uquotino)  {
1913
1969
                        do_warn(
1914
 
"entry #%d, bno %d in directory %llu references user quota inode %llu\n",
 
1970
_("entry #%d, bno %d in directory %llu references user quota inode %llu\n"),
1915
1971
                                i, da_bno, ino, lino);
1916
1972
                        if (!no_modify)  {
1917
1973
                                do_warn(
1918
 
                                "\tclearing ino number in entry %d...\n", i);
 
1974
                                _("\tclearing ino number in entry %d...\n"),
 
1975
                                        i);
1919
1976
 
1920
1977
                                lino = NULLFSINO;
1921
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
1978
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
1979
                                        &namest->inumber, ARCH_CONVERT);
1922
1980
                                *buf_dirty = 1;
1923
1981
                        } else  {
1924
1982
                                do_warn(
1925
 
                                "\twould clear ino number in entry %d...\n", i);
 
1983
                                _("\twould clear ino number in entry %d...\n"),
 
1984
                                        i);
1926
1985
                        }
1927
1986
                } else if (lino == mp->m_sb.sb_gquotino)  {
1928
1987
                        do_warn(
1929
 
"entry #%d, bno %d in directory %llu references group quota inode %llu\n",
 
1988
_("entry #%d, bno %d in directory %llu references group quota inode %llu\n"),
1930
1989
                                i, da_bno, ino, lino);
1931
1990
                        if (!no_modify)  {
1932
1991
                                do_warn(
1933
 
                                "\tclearing ino number in entry %d...\n", i);
 
1992
                                _("\tclearing ino number in entry %d...\n"),
 
1993
                                        i);
1934
1994
 
1935
1995
                                lino = NULLFSINO;
1936
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
1996
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
1997
                                        &namest->inumber, ARCH_CONVERT);
1937
1998
                                *buf_dirty = 1;
1938
1999
                        } else  {
1939
2000
                                do_warn(
1940
 
                                "\twould clear ino number in entry %d...\n", i);
 
2001
                                _("\twould clear ino number in entry %d...\n"),
 
2002
                                        i);
1941
2003
                        }
1942
2004
                } else if (lino == old_orphanage_ino)  {
1943
2005
                        /*
1967
2029
                        if (!ino_discovery && is_inode_free(irec_p, ino_off))  {
1968
2030
                                if (!no_modify)  {
1969
2031
                                        do_warn(
1970
 
"entry references free inode %llu in directory %llu, will clear entry\n",
 
2032
_("entry references free inode %llu in directory %llu, will clear entry\n"),
1971
2033
                                                lino, ino);
1972
2034
                                        lino = NULLFSINO;
1973
2035
                                        XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
1974
 
                                                        &namest->inumber, ARCH_CONVERT);
 
2036
                                                &namest->inumber, ARCH_CONVERT);
1975
2037
                                        *buf_dirty = 1;
1976
2038
                                } else  {
1977
2039
                                        do_warn(
1978
 
"entry references free inode %llu in directory %llu, would clear entry\n",
 
2040
_("entry references free inode %llu in directory %llu, would clear entry\n"),
1979
2041
                                                lino, ino);
1980
2042
                                }
1981
2043
                        }
1983
2045
                        add_inode_uncertain(mp, lino, 0);
1984
2046
                } else  {
1985
2047
                        do_warn(
1986
 
        "bad ino number %llu in dir ino %llu, entry #%d, bno %d\n",
 
2048
        _("bad ino number %llu in dir ino %llu, entry #%d, bno %d\n"),
1987
2049
                                lino, ino, i, da_bno);
1988
2050
                        if (!no_modify)  {
1989
 
                                do_warn("clearing inode number...\n");
 
2051
                                do_warn(_("clearing inode number...\n"));
1990
2052
                                lino = NULLFSINO;
1991
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
2053
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
2054
                                        &namest->inumber, ARCH_CONVERT);
1992
2055
                                *buf_dirty = 1;
1993
2056
                        } else  {
1994
 
                                do_warn("would clear inode number...\n");
 
2057
                                do_warn(_("would clear inode number...\n"));
1995
2058
                        }
1996
2059
                }
1997
2060
                /*
2011
2074
 
2012
2075
                        if (INT_GET(leaf->hdr.count, ARCH_CONVERT) > 1)  {
2013
2076
                                do_warn(
2014
 
        "entry #%d, dir inode %llu, has zero-len name, deleting entry\n",
 
2077
        _("entry #%d, dir inode %llu, has zero-len name, deleting entry\n"),
2015
2078
                                        i, ino);
2016
2079
                                ASSERT(INT_GET(leaf->hdr.count, ARCH_CONVERT) > i);
2017
2080
 
2018
 
                                bytes = (INT_GET(leaf->hdr.count, ARCH_CONVERT) - i) *
 
2081
                                bytes = (INT_GET(leaf->hdr.count,
 
2082
                                                ARCH_CONVERT) - i) *
2019
2083
                                        sizeof(xfs_dir_leaf_entry_t);
2020
2084
 
2021
2085
                                /*
2025
2089
                                 * just zero it.
2026
2090
                                 */
2027
2091
                                if (bytes > sizeof(xfs_dir_leaf_entry_t))  {
2028
 
                                        memmove(entry, entry + 1,
2029
 
                                                bytes);
 
2092
                                        memmove(entry, entry + 1, bytes);
2030
2093
                                        bzero((void *)
2031
2094
                                                ((__psint_t) entry + bytes),
2032
2095
                                                sizeof(xfs_dir_leaf_entry_t));
2050
2113
                                 * inode number for now
2051
2114
                                 */
2052
2115
                                do_warn(
2053
 
        "entry #%d, dir inode %llu, has zero-len name, marking entry bad\n",
 
2116
        _("entry #%d, dir inode %llu, has zero-len name, marking entry bad\n"),
2054
2117
                                        i, ino);
2055
 
                                INT_SET(entry->nameidx, ARCH_CONVERT, mp->m_sb.sb_blocksize -
 
2118
                                INT_SET(entry->nameidx, ARCH_CONVERT,
 
2119
                                        mp->m_sb.sb_blocksize -
2056
2120
                                                sizeof(xfs_dir_leaf_name_t));
2057
2121
                                namest = XFS_DIR_LEAF_NAMESTRUCT(leaf,
2058
 
                                                INT_GET(entry->nameidx, ARCH_CONVERT));
2059
 
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino, &namest->inumber, ARCH_CONVERT);
 
2122
                                                INT_GET(entry->nameidx,
 
2123
                                                        ARCH_CONVERT));
 
2124
                                XFS_DIR_SF_PUT_DIRINO_ARCH(&lino,
 
2125
                                        &namest->inumber, ARCH_CONVERT);
2060
2126
                                namest->name[0] = '/';
2061
2127
                        }
2062
 
                } else if (INT_GET(entry->nameidx, ARCH_CONVERT) + entry->namelen > XFS_LBSIZE(mp))  {
 
2128
                } else if (INT_GET(entry->nameidx, ARCH_CONVERT) +
 
2129
                                        entry->namelen > XFS_LBSIZE(mp))  {
2063
2130
                        do_warn(
2064
 
"bad size, entry #%d in dir inode %llu, block %u -- entry overflows block\n",
2065
 
                        i, ino, da_bno);
 
2131
_("bad size, entry #%d in dir inode %llu, block %u -- entry overflows block\n"),
 
2132
                                i, ino, da_bno);
2066
2133
 
2067
2134
                        return(1);
2068
2135
                }
2072
2139
 
2073
2140
                if (set_da_freemap(mp, dir_freemap, start, stop))  {
2074
2141
                        do_warn(
2075
 
"dir entry slot %d in block %u conflicts with used space in dir inode %llu\n",
 
2142
_("dir entry slot %d in block %u conflicts with used space in dir inode %llu\n"),
2076
2143
                                i, da_bno, ino);
2077
2144
                        return(1);
2078
2145
                }
2111
2178
                         */
2112
2179
                        if (!no_modify)  {
2113
2180
                                do_warn(
2114
 
        "illegal name \"%s\" in directory inode %llu, entry will be cleared\n",
 
2181
_("illegal name \"%s\" in directory inode %llu, entry will be cleared\n"),
2115
2182
                                        fname, ino);
2116
2183
                                namest->name[0] = '/';
2117
2184
                                *buf_dirty = 1;
2118
2185
                        } else  {
2119
2186
                                do_warn(
2120
 
        "illegal name \"%s\" in directory inode %llu, entry would be cleared\n",
 
2187
_("illegal name \"%s\" in directory inode %llu, entry would be cleared\n"),
2121
2188
                                        fname, ino);
2122
2189
                        }
2123
 
                } else if (!nm_illegal && INT_GET(entry->hashval, ARCH_CONVERT) != hashval)  {
 
2190
                } else if (!nm_illegal &&
 
2191
                           INT_GET(entry->hashval, ARCH_CONVERT) != hashval)  {
2124
2192
                        /*
2125
2193
                         * try resetting the hashvalue to the correct
2126
2194
                         * value for the string, if the string has been
2127
2195
                         * corrupted, too, that will get picked up next
2128
2196
                         */
2129
 
                        do_warn("\tmismatched hash value for entry \"%s\"\n",
 
2197
                        do_warn(_("\tmismatched hash value for entry \"%s\"\n"),
2130
2198
                                fname);
2131
2199
                        if (!no_modify)  {
2132
2200
                                do_warn(
2133
 
                        "\t\tin directory inode %llu.  resetting hash value.\n",
 
2201
                _("\t\tin directory inode %llu.  resetting hash value.\n"),
2134
2202
                                        ino);
2135
2203
                                INT_SET(entry->hashval, ARCH_CONVERT, hashval);
2136
2204
                                *buf_dirty = 1;
2137
2205
                        } else  {
2138
2206
                                do_warn(
2139
 
                "\t\tin directory inode %llu.  would reset hash value.\n",
 
2207
                _("\t\tin directory inode %llu.  would reset hash value.\n"),
2140
2208
                                        ino);
2141
2209
                        }
2142
2210
                }
2143
 
                
 
2211
 
2144
2212
                /*
2145
2213
                 * now we can mark entries with NULLFSINO's bad
2146
2214
                 */
2166
2234
                         * inode number in the entry so we can attach
2167
2235
                         * the inode to the orphanage later.
2168
2236
                         */
2169
 
                        do_warn("\tbad hash ordering for entry \"%s\"\n",
 
2237
                        do_warn(_("\tbad hash ordering for entry \"%s\"\n"),
2170
2238
                                fname);
2171
2239
                        if (!no_modify)  {
2172
2240
                                do_warn(
2173
 
                "\t\tin directory inode %llu.  will clear entry\n",
 
2241
                        _("\t\tin directory inode %llu.  will clear entry\n"),
2174
2242
                                        ino);
2175
 
                                INT_SET(entry->hashval, ARCH_CONVERT, last_hashval);
 
2243
                                INT_SET(entry->hashval, ARCH_CONVERT,
 
2244
                                        last_hashval);
2176
2245
                                namest->name[0] = '/';
2177
2246
                                *buf_dirty = 1;
2178
2247
                        } else  {
2179
2248
                                do_warn(
2180
 
                "\t\tin directory inode %llu.  would clear entry\n",
 
2249
                        _("\t\tin directory inode %llu.  would clear entry\n"),
2181
2250
                                        ino);
2182
2251
                        }
2183
2252
                }
2188
2257
                 * if heap data conflicts with something,
2189
2258
                 * blow it out and skip the rest of the loop
2190
2259
                 */
2191
 
                if (set_da_freemap(mp, dir_freemap, INT_GET(entry->nameidx, ARCH_CONVERT),
2192
 
                                INT_GET(entry->nameidx, ARCH_CONVERT) + sizeof(xfs_dir_leaf_name_t) +
2193
 
                                entry->namelen - 1))  {
 
2260
                if (set_da_freemap(mp, dir_freemap,
 
2261
                                INT_GET(entry->nameidx, ARCH_CONVERT),
 
2262
                                INT_GET(entry->nameidx, ARCH_CONVERT)
 
2263
                                + sizeof(xfs_dir_leaf_name_t)
 
2264
                                + entry->namelen - 1))  {
2194
2265
                        do_warn(
2195
 
"name \"%s\" (block %u, slot %d) conflicts with used space in dir inode %llu\n",
 
2266
_("name \"%s\" (block %u, slot %d) conflicts with used space in dir inode %llu\n"),
2196
2267
                                fname, da_bno, i, ino);
2197
2268
                        if (!no_modify)  {
2198
2269
                                entry->namelen = 0;
2199
2270
                                *buf_dirty = 1;
2200
2271
 
2201
2272
                                do_warn(
2202
 
                "will clear entry \"%s\" (#%d) in directory inode %llu\n",
 
2273
                _("will clear entry \"%s\" (#%d) in directory inode %llu\n"),
2203
2274
                                        fname, i, ino);
2204
2275
                        } else  {
2205
2276
                                do_warn(
2206
 
                "would clear entry \"%s\" (#%d)in directory inode %llu\n",
 
2277
                _("would clear entry \"%s\" (#%d)in directory inode %llu\n"),
2207
2278
                                        fname, i, ino);
2208
2279
                        }
2209
2280
                        continue;
2239
2310
                                                ino != mp->m_sb.sb_rootino)  {
2240
2311
                                        *parent = NULLFSINO;
2241
2312
                                        do_warn(
2242
 
        "bad .. entry in dir ino %llu, points to self",
 
2313
                        _("bad .. entry in dir ino %llu, points to self"),
2243
2314
                                                ino);
2244
2315
                                        if (!no_modify)  {
2245
 
                                                do_warn("will clear entry\n");
2246
 
 
 
2316
                                                do_warn(
 
2317
                                                _("will clear entry\n"));
2247
2318
                                                namest->name[0] = '/';
2248
2319
                                                *buf_dirty = 1;
2249
2320
                                        } else  {
2250
 
                                                do_warn("would clear entry\n");
 
2321
                                                do_warn(
 
2322
                                                _("would clear entry\n"));
2251
2323
                                        }
2252
2324
                                } else if (ino != lino &&
2253
2325
                                                ino == mp->m_sb.sb_rootino)  {
2257
2329
                                         */
2258
2330
                                        if (!no_modify)  {
2259
2331
                                                do_warn(
2260
 
                "correcting .. entry in root inode %llu, was %llu\n",
 
2332
                _("correcting .. entry in root inode %llu, was %llu\n"),
2261
2333
                                                        ino, *parent);
2262
2334
                                                XFS_DIR_SF_PUT_DIRINO_ARCH(
2263
2335
                                                        &ino,
2265
2337
                                                *buf_dirty = 1;
2266
2338
                                        } else  {
2267
2339
                                                do_warn(
2268
 
        "bad .. entry (%llu) in root inode %llu should be %llu\n",
 
2340
                _("bad .. entry (%llu) in root inode %llu should be %llu\n"),
2269
2341
                                                        *parent,
2270
2342
                                                        ino, ino);
2271
2343
                                        }
2282
2354
                                 */
2283
2355
                                if (!no_modify)  {
2284
2356
                                        do_warn(
2285
 
"multiple .. entries in directory inode %llu, will clear second entry\n",
 
2357
_("multiple .. entries in directory inode %llu, will clear second entry\n"),
2286
2358
                                                ino);
2287
2359
                                        namest->name[0] = '/';
2288
2360
                                        *buf_dirty = 1;
2289
2361
                                } else  {
2290
2362
                                        do_warn(
2291
 
"multiple .. entries in directory inode %llu, would clear second entry\n",
 
2363
_("multiple .. entries in directory inode %llu, would clear second entry\n"),
2292
2364
                                                ino);
2293
2365
                                }
2294
2366
                        }
2301
2373
                                if (lino != ino)  {
2302
2374
                                        if (!no_modify)  {
2303
2375
                                                do_warn(
2304
 
        ". in directory inode %llu has wrong value (%llu), fixing entry...\n",
 
2376
_(". in directory inode %llu has wrong value (%llu), fixing entry...\n"),
2305
2377
                                                        ino, lino);
2306
2378
                                                XFS_DIR_SF_PUT_DIRINO_ARCH(&ino,
2307
 
                                                        &namest->inumber, ARCH_CONVERT);
 
2379
                                                        &namest->inumber,
 
2380
                                                                ARCH_CONVERT);
2308
2381
                                                *buf_dirty = 1;
2309
2382
                                        } else  {
2310
2383
                                                do_warn(
2311
 
                        ". in directory inode %llu has wrong value (%llu)\n",
 
2384
                        _(". in directory inode %llu has wrong value (%llu)\n"),
2312
2385
                                                        ino, lino);
2313
2386
                                        }
2314
2387
                                }
2315
2388
                        } else  {
2316
2389
                                do_warn(
2317
 
                                "multiple . entries in directory inode %llu\n",
 
2390
                        _("multiple . entries in directory inode %llu\n"),
2318
2391
                                        ino);
2319
2392
                                /*
2320
2393
                                 * mark entry as to be junked.
2321
2394
                                 */
2322
2395
                                if (!no_modify)  {
2323
2396
                                        do_warn(
2324
 
                        "will clear one . entry in directory inode %llu\n",
 
2397
                        _("will clear one . entry in directory inode %llu\n"),
2325
2398
                                                ino);
2326
2399
                                        namest->name[0] = '/';
2327
2400
                                        *buf_dirty = 1;
2328
2401
                                } else  {
2329
2402
                                        do_warn(
2330
 
                        "would clear one . entry in directory inode %llu\n",
 
2403
                        _("would clear one . entry in directory inode %llu\n"),
2331
2404
                                                ino);
2332
2405
                                }
2333
2406
                        }
2337
2410
                         */
2338
2411
                        if (lino == ino)  {
2339
2412
                                do_warn(
2340
 
                        "entry \"%s\" in directory inode %llu points to self, ",
 
2413
                _("entry \"%s\" in directory inode %llu points to self, "),
2341
2414
                                        fname, ino);
2342
2415
                                if (!no_modify)  {
2343
 
                                        do_warn("will clear entry\n");
 
2416
                                        do_warn(_("will clear entry\n"));
2344
2417
                                        namest->name[0] = '/';
2345
2418
                                        *buf_dirty = 1;
2346
2419
                                } else  {
2347
 
                                        do_warn("would clear entry\n");
 
2420
                                        do_warn(_("would clear entry\n"));
2348
2421
                                }
2349
2422
                        }
2350
2423
                }
2356
2429
         * pointing to used bytes.  we're being conservative here
2357
2430
         * since the block will get compacted anyhow by the kernel.
2358
2431
         */
2359
 
        if ((leaf->hdr.holes == 0 && first_used != INT_GET(leaf->hdr.firstused, ARCH_CONVERT)) ||
2360
 
                        INT_GET(leaf->hdr.firstused, ARCH_CONVERT) > first_used)  {
 
2432
        if ((leaf->hdr.holes == 0 &&
 
2433
             first_used != INT_GET(leaf->hdr.firstused, ARCH_CONVERT)) ||
 
2434
            INT_GET(leaf->hdr.firstused, ARCH_CONVERT) > first_used)  {
2361
2435
                if (!no_modify)  {
2362
2436
                        if (verbose)
2363
2437
                                do_warn(
2364
 
"- resetting first used heap value from %d to %d in block %u of dir ino %llu\n",
2365
 
                                        (int) INT_GET(leaf->hdr.firstused, ARCH_CONVERT), first_used,
2366
 
                                        da_bno, ino);
 
2438
_("- resetting first used heap value from %d to %d in block %u of dir ino %llu\n"),
 
2439
                                        (int) INT_GET(leaf->hdr.firstused,
 
2440
                                                ARCH_CONVERT),
 
2441
                                        first_used, da_bno, ino);
2367
2442
                        INT_SET(leaf->hdr.firstused, ARCH_CONVERT, first_used);
2368
2443
                        *buf_dirty = 1;
2369
2444
                } else  {
2370
2445
                        if (verbose)
2371
2446
                                do_warn(
2372
 
"- would reset first used value from %d to %d in block %u of dir ino %llu\n",
2373
 
                                        (int) INT_GET(leaf->hdr.firstused, ARCH_CONVERT), first_used,
2374
 
                                        da_bno, ino);
 
2447
_("- would reset first used value from %d to %d in block %u of dir ino %llu\n"),
 
2448
                                        (int) INT_GET(leaf->hdr.firstused,
 
2449
                                                ARCH_CONVERT),
 
2450
                                        first_used, da_bno, ino);
2375
2451
                }
2376
2452
        }
2377
2453
 
2379
2455
                if (!no_modify)  {
2380
2456
                        if (verbose)
2381
2457
                                do_warn(
2382
 
"- resetting namebytes cnt from %d to %d in block %u of dir inode %llu\n",
2383
 
                                        (int) INT_GET(leaf->hdr.namebytes, ARCH_CONVERT), bytes_used,
2384
 
                                        da_bno, ino);
 
2458
_("- resetting namebytes cnt from %d to %d in block %u of dir inode %llu\n"),
 
2459
                                        (int) INT_GET(leaf->hdr.namebytes,
 
2460
                                                ARCH_CONVERT),
 
2461
                                        bytes_used, da_bno, ino);
2385
2462
                        INT_SET(leaf->hdr.namebytes, ARCH_CONVERT, bytes_used);
2386
2463
                        *buf_dirty = 1;
2387
2464
                } else  {
2388
2465
                        if (verbose)
2389
2466
                                do_warn(
2390
 
"- would reset namebytes cnt from %d to %d in block %u of dir inode %llu\n",
2391
 
                                        (int) INT_GET(leaf->hdr.namebytes, ARCH_CONVERT), bytes_used,
2392
 
                                        da_bno, ino);
 
2467
_("- would reset namebytes cnt from %d to %d in block %u of dir inode %llu\n"),
 
2468
                                        (int) INT_GET(leaf->hdr.namebytes,
 
2469
                                                ARCH_CONVERT),
 
2470
                                        bytes_used, da_bno, ino);
2393
2471
                }
2394
2472
        }
2395
2473
 
2422
2500
                if (holemap.lost_holes > 0)  {
2423
2501
                        if (verbose)
2424
2502
                                do_warn(
2425
 
        "- found unexpected lost holes in block %u, dir inode %llu\n",
 
2503
        _("- found unexpected lost holes in block %u, dir inode %llu\n"),
2426
2504
                                        da_bno, ino);
2427
2505
 
2428
2506
                        reset_holes = 1;
2430
2508
                                XFS_DIR_LEAF_MAPSIZE, ino, da_bno))  {
2431
2509
                        if (verbose)
2432
2510
                                do_warn(
2433
 
                        "- hole info non-optimal in block %u, dir inode %llu\n",
 
2511
                _("- hole info non-optimal in block %u, dir inode %llu\n"),
2434
2512
                                        da_bno, ino);
2435
2513
                        reset_holes = 1;
2436
2514
                }
2437
2515
        } else if (verify_da_freemap(mp, dir_freemap, &holemap, ino, da_bno))  {
2438
2516
                if (verbose)
2439
2517
                        do_warn(
2440
 
                        "- hole info incorrect in block %u, dir inode %llu\n",
 
2518
                _("- hole info incorrect in block %u, dir inode %llu\n"),
2441
2519
                                da_bno, ino);
2442
2520
                reset_holes = 1;
2443
2521
        }
2448
2526
                 */
2449
2527
                if (verbose)  {
2450
2528
                        do_warn(
2451
 
        "- existing hole info for block %d, dir inode %llu (base, size) - \n",
 
2529
_("- existing hole info for block %d, dir inode %llu (base, size) - \n"),
2452
2530
                                da_bno, ino);
2453
2531
                        do_warn("- \t");
2454
2532
                        for (i = 0; i < XFS_DIR_LEAF_MAPSIZE; i++)  {
2455
2533
                                do_warn(
2456
2534
                                "- (%d, %d) ", bholemap.hentries[i].base,
2457
 
                                        bholemap.hentries[i].size);  
 
2535
                                        bholemap.hentries[i].size);
2458
2536
                        }
2459
 
                        do_warn("- holes flag = %d\n", bholemap.lost_holes);
 
2537
                        do_warn(_("- holes flag = %d\n"), bholemap.lost_holes);
2460
2538
                }
2461
2539
 
2462
2540
                if (!no_modify)  {
2463
2541
                        if (verbose)
2464
2542
                                do_warn(
2465
 
                "- compacting block %u in dir inode %llu\n",
 
2543
                        _("- compacting block %u in dir inode %llu\n"),
2466
2544
                                        da_bno, ino);
2467
2545
 
2468
2546
                        new_leaf = (xfs_dir_leafblock_t *) &dirbuf[0];
2503
2581
                                                sizeof(xfs_dir_leaf_entry_t)
2504
2582
                                                + (__psint_t) d_entry)  {
2505
2583
                                        do_warn(
2506
 
        "not enough space in block %u of dir inode %llu for all entries\n",
 
2584
        _("not enough space in block %u of dir inode %llu for all entries\n"),
2507
2585
                                                da_bno, ino);
2508
2586
                                        break;
2509
2587
                                }
2571
2649
                } else  {
2572
2650
                        if (verbose)
2573
2651
                                do_warn(
2574
 
                        "- would compact block %u in dir inode %llu\n",
 
2652
                        _("- would compact block %u in dir inode %llu\n"),
2575
2653
                                        da_bno, ino);
2576
2654
                }
2577
2655
        }
2632
2710
                ASSERT(da_bno != 0);
2633
2711
 
2634
2712
                if (dev_bno == NULLDFSBNO) {
2635
 
                        do_warn("can't map block %u for directory inode %llu\n",
 
2713
                        do_warn(
 
2714
                        _("can't map block %u for directory inode %llu\n"),
2636
2715
                                da_bno, ino);
2637
2716
                        goto error_out;
2638
2717
                }
2642
2721
                bp = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, dev_bno),
2643
2722
                                        XFS_FSB_TO_BB(mp, 1), 0);
2644
2723
                if (!bp) {
2645
 
                        do_warn("can't read file block %u (fsbno %llu, daddr %lld) "
2646
 
                                "for directory inode %llu\n",
 
2724
                        do_warn(
 
2725
                        _("can't read file block %u (fsbno %llu, daddr %lld) "
 
2726
                          "for directory inode %llu\n"),
2647
2727
                                da_bno, dev_bno, (__int64_t) bd_addr, ino);
2648
2728
                        goto error_out;
2649
2729
                }
2653
2733
                /*
2654
2734
                 * check magic number for leaf directory btree block
2655
2735
                 */
2656
 
                if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) {
2657
 
                        do_warn("bad directory leaf magic # %#x for dir ino %llu\n",
2658
 
                                INT_GET(leaf->hdr.info.magic, ARCH_CONVERT), ino);
 
2736
                if (XFS_DIR_LEAF_MAGIC !=
 
2737
                    INT_GET(leaf->hdr.info.magic, ARCH_CONVERT)) {
 
2738
                        do_warn(
 
2739
                        _("bad directory leaf magic # %#x for dir ino %llu\n"),
 
2740
                                INT_GET(leaf->hdr.info.magic, ARCH_CONVERT),
 
2741
                                ino);
2659
2742
                        libxfs_putbuf(bp);
2660
2743
                        goto error_out;
2661
2744
                }
2692
2775
                da_cursor->level[0].dirty = buf_dirty;
2693
2776
 
2694
2777
                if (INT_GET(leaf->hdr.info.back, ARCH_CONVERT) != prev_bno)  {
2695
 
                        do_warn("bad sibling back pointer for directory block %u "
2696
 
                                "in directory inode %llu\n", da_bno, ino);
 
2778
                        do_warn(_("bad sibling back pointer for directory "
 
2779
                                  "block %u in directory inode %llu\n"),
 
2780
                                da_bno, ino);
2697
2781
                        libxfs_putbuf(bp);
2698
2782
                        goto error_out;
2699
2783
                }
2723
2807
                /*
2724
2808
                 * verify the final path up (right-hand-side) if still ok
2725
2809
                 */
2726
 
                do_warn("bad hash path in directory %llu\n", da_cursor->ino);
 
2810
                do_warn(_("bad hash path in directory %llu\n"), da_cursor->ino);
2727
2811
                goto error_out;
2728
2812
        }
2729
2813
 
2831
2915
        if (INT_GET(dip->di_core.di_size, ARCH_CONVERT) <
2832
2916
                        (da_cursor.greatest_bno + 1) * mp->m_sb.sb_blocksize)  {
2833
2917
                if ((xfs_fsize_t) (da_cursor.greatest_bno
2834
 
                                * mp->m_sb.sb_blocksize) > UINT_MAX)  { 
 
2918
                                * mp->m_sb.sb_blocksize) > UINT_MAX)  {
2835
2919
                        do_warn(
2836
 
"out of range internal directory block numbers (inode %llu)\n",
 
2920
        _("out of range internal directory block numbers (inode %llu)\n"),
2837
2921
                                ino);
2838
2922
                        return(1);
2839
2923
                }
2840
2924
 
2841
2925
                do_warn(
2842
 
"setting directory inode (%llu) size to %llu bytes, was %lld bytes\n",
 
2926
_("setting directory inode (%llu) size to %llu bytes, was %lld bytes\n"),
2843
2927
                        ino,
2844
2928
                        (xfs_dfiloff_t) (da_cursor.greatest_bno + 1)
2845
2929
                                * mp->m_sb.sb_blocksize,
2894
2978
 
2895
2979
        bno = blkmap_get(blkmap, 0);
2896
2980
        if (bno == NULLDFSBNO) {
2897
 
                do_warn("block 0 for directory inode %llu is missing\n", ino);
 
2981
                do_warn(_("block 0 for directory inode %llu is missing\n"),
 
2982
                        ino);
2898
2983
                return(1);
2899
2984
        }
2900
2985
        bp = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
2901
2986
                        XFS_FSB_TO_BB(mp, 1), 0);
2902
2987
        if (!bp) {
2903
 
                do_warn("can't read block 0 for directory inode %llu\n", ino);
 
2988
                do_warn(_("can't read block 0 for directory inode %llu\n"),
 
2989
                        ino);
2904
2990
                return(1);
2905
2991
        }
2906
2992
        /*
2912
2998
         * check magic number for leaf directory btree block
2913
2999
         */
2914
3000
        if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) {
2915
 
                do_warn("bad directory leaf magic # %#x for dir ino %llu\n",
 
3001
                do_warn(_("bad directory leaf magic # %#x for dir ino %llu\n"),
2916
3002
                        INT_GET(leaf->hdr.info.magic, ARCH_CONVERT), ino);
2917
3003
                libxfs_putbuf(bp);
2918
3004
                return(1);
2934
3020
         * check sibling pointers in leaf block (above doesn't do it)
2935
3021
         */
2936
3022
        if (INT_GET(leaf->hdr.info.forw, ARCH_CONVERT) != 0 ||
2937
 
                                INT_GET(leaf->hdr.info.back, ARCH_CONVERT) != 0)  {
 
3023
            INT_GET(leaf->hdr.info.back, ARCH_CONVERT) != 0)  {
2938
3024
                if (!no_modify)  {
2939
 
                        do_warn("clearing forw/back pointers for directory inode "
2940
 
                                "%llu\n", ino);
 
3025
                        do_warn(_("clearing forw/back pointers for "
 
3026
                                  "directory inode %llu\n"), ino);
2941
3027
                        buf_dirty = 1;
2942
3028
                        INT_ZERO(leaf->hdr.info.forw, ARCH_CONVERT);
2943
3029
                        INT_ZERO(leaf->hdr.info.back, ARCH_CONVERT);
2944
3030
                } else  {
2945
 
                        do_warn("would clear forw/back pointers for directory inode "
2946
 
                                "%llu\n", ino);
 
3031
                        do_warn(_("would clear forw/back pointers for "
 
3032
                                  "directory inode %llu\n"), ino);
2947
3033
                }
2948
3034
        }
2949
3035
 
2986
3072
         * is only called ONCE so all the subordinate routines will
2987
3073
         * fix '.' and junk '..' if they're bogus.
2988
3074
         */
2989
 
        if (INT_GET(dip->di_core.di_size, ARCH_CONVERT) <= XFS_DFORK_DSIZE_ARCH(dip, mp, ARCH_CONVERT))  {
 
3075
        if (INT_GET(dip->di_core.di_size, ARCH_CONVERT) <=
 
3076
            XFS_DFORK_DSIZE_ARCH(dip, mp, ARCH_CONVERT))  {
2990
3077
                dot = 1;
2991
3078
                dotdot = 1;
2992
3079
                if (process_shortform_dir(mp, ino, dip, ino_discovery,
2993
3080
                                dino_dirty, parent, dirname, &repair))  {
2994
3081
                        res = 1;
2995
3082
                }
2996
 
        } else if (INT_GET(dip->di_core.di_size, ARCH_CONVERT) <= XFS_LBSIZE(mp))  {
 
3083
        } else if (INT_GET(dip->di_core.di_size, ARCH_CONVERT) <=
 
3084
                   XFS_LBSIZE(mp))  {
2997
3085
                if (process_leaf_dir(mp, ino, dip, ino_discovery,
2998
3086
                                dino_dirty, blkmap, &dot, &dotdot,
2999
3087
                                parent, dirname, &repair))  {
3010
3098
         * bad . entries in all directories will be fixed up in phase 6
3011
3099
         */
3012
3100
        if (dot == 0) {
3013
 
                do_warn("no . entry for directory %llu\n", ino);
 
3101
                do_warn(_("no . entry for directory %llu\n"), ino);
3014
3102
        }
3015
3103
 
3016
3104
        /*
3020
3108
         * fixed in place since we know what it should be
3021
3109
         */
3022
3110
        if (dotdot == 0 && ino != mp->m_sb.sb_rootino) {
3023
 
                do_warn("no .. entry for directory %llu\n", ino);
 
3111
                do_warn(_("no .. entry for directory %llu\n"), ino);
3024
3112
        } else if (dotdot == 0 && ino == mp->m_sb.sb_rootino) {
3025
 
                do_warn("no .. entry for root directory %llu\n", ino);
 
3113
                do_warn(_("no .. entry for root directory %llu\n"), ino);
3026
3114
                need_root_dotdot = 1;
3027
3115
        }
3028
 
        
 
3116
 
3029
3117
#ifdef XR_DIR_TRACE
3030
3118
        fprintf(stderr, "(process_dir), parent of %llu is %llu\n", ino, parent);
3031
3119
#endif