Whamcloud - gitweb
e2fsck: return more status if fsck aborts
[tools/e2fsprogs.git] / e2fsck / util.c
1 /*
2  * util.c --- miscellaneous utilities
3  *
4  * Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
5  *
6  * %Begin-Header%
7  * This file may be redistributed under the terms of the GNU Public
8  * License.
9  * %End-Header%
10  */
11
12 #include "config.h"
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <unistd.h>
16 #include <string.h>
17 #include <ctype.h>
18 #ifdef __linux__
19 #include <sys/utsname.h>
20 #endif
21
22 #ifdef HAVE_CONIO_H
23 #undef HAVE_TERMIOS_H
24 #include <conio.h>
25 #define read_a_char()   getch()
26 #else
27 #ifdef HAVE_TERMIOS_H
28 #include <termios.h>
29 #endif
30 #endif
31
32 #ifdef HAVE_MALLOC_H
33 #include <malloc.h>
34 #endif
35
36 #ifdef HAVE_ERRNO_H
37 #include <errno.h>
38 #endif
39
40 #include "e2fsck.h"
41
42 extern e2fsck_t e2fsck_global_ctx;   /* Try your very best not to use this! */
43
44 #include <time.h>
45 #include <sys/time.h>
46 #include <sys/resource.h>
47
48 void fatal_error(e2fsck_t ctx, const char *msg)
49 {
50         ext2_filsys fs = ctx->fs;
51         int exit_value = FSCK_ERROR;
52
53         if (msg)
54                 fprintf (stderr, "e2fsck: %s\n", msg);
55         if (!fs)
56                 goto out;
57         if (fs->io) {
58                 ext2fs_mmp_stop(ctx->fs);
59                 if (ctx->fs->io->magic == EXT2_ET_MAGIC_IO_CHANNEL)
60                         io_channel_flush(ctx->fs->io);
61                 else
62                         fprintf(stderr, "e2fsck: io manager magic bad!\n");
63         }
64         if (ext2fs_test_changed(fs)) {
65                 exit_value |= FSCK_NONDESTRUCT;
66                 printf(_("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n"),
67                         ctx->device_name);
68                 if (ctx->mount_flags & EXT2_MF_ISROOT)
69                         exit_value |= FSCK_REBOOT;
70         }
71         if (!ext2fs_test_valid(fs)) {
72                 printf(_("\n%s: ********** WARNING: Filesystem still has "
73                          "errors **********\n\n"), ctx->device_name);
74                 exit_value |= FSCK_UNCORRECTED;
75                 exit_value &= ~FSCK_NONDESTRUCT;
76         }
77 out:
78         ctx->flags |= E2F_FLAG_ABORT;
79         if (ctx->flags & E2F_FLAG_SETJMP_OK)
80                 longjmp(ctx->abort_loc, 1);
81         exit(exit_value);
82 }
83
84 void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned int size,
85                              const char *description)
86 {
87         void *ret;
88         char buf[256];
89
90 #ifdef DEBUG_ALLOCATE_MEMORY
91         printf("Allocating %u bytes for %s...\n", size, description);
92 #endif
93         ret = malloc(size);
94         if (!ret) {
95                 sprintf(buf, "Can't allocate %s\n", description);
96                 fatal_error(ctx, buf);
97         }
98         memset(ret, 0, size);
99         return ret;
100 }
101
102 char *string_copy(e2fsck_t ctx EXT2FS_ATTR((unused)),
103                   const char *str, int len)
104 {
105         char    *ret;
106
107         if (!str)
108                 return NULL;
109         if (!len)
110                 len = strlen(str);
111         ret = malloc(len+1);
112         if (ret) {
113                 strncpy(ret, str, len);
114                 ret[len] = 0;
115         }
116         return ret;
117 }
118
119 #ifndef HAVE_STRNLEN
120 /*
121  * Incredibly, libc5 doesn't appear to have strnlen.  So we have to
122  * provide our own.
123  */
124 int e2fsck_strnlen(const char * s, int count)
125 {
126         const char *cp = s;
127
128         while (count-- && *cp)
129                 cp++;
130         return cp - s;
131 }
132 #endif
133
134 #ifndef HAVE_CONIO_H
135 static int read_a_char(void)
136 {
137         char    c;
138         int     r;
139         int     fail = 0;
140
141         while(1) {
142                 if (e2fsck_global_ctx &&
143                     (e2fsck_global_ctx->flags & E2F_FLAG_CANCEL)) {
144                         return 3;
145                 }
146                 r = read(0, &c, 1);
147                 if (r == 1)
148                         return c;
149                 if (fail++ > 100)
150                         break;
151         }
152         return EOF;
153 }
154 #endif
155
156 int ask_yn(const char * string, int def)
157 {
158         int             c;
159         const char      *defstr;
160         const char      *short_yes = _("yY");
161         const char      *short_no = _("nN");
162
163 #ifdef HAVE_TERMIOS_H
164         struct termios  termios, tmp;
165
166         tcgetattr (0, &termios);
167         tmp = termios;
168         tmp.c_lflag &= ~(ICANON | ECHO);
169         tmp.c_cc[VMIN] = 1;
170         tmp.c_cc[VTIME] = 0;
171         tcsetattr (0, TCSANOW, &tmp);
172 #endif
173
174         if (def == 1)
175                 defstr = _(_("<y>"));
176         else if (def == 0)
177                 defstr = _(_("<n>"));
178         else
179                 defstr = _(" (y/n)");
180         printf("%s%s? ", string, defstr);
181         while (1) {
182                 fflush (stdout);
183                 if ((c = read_a_char()) == EOF)
184                         break;
185                 if (c == 3) {
186 #ifdef HAVE_TERMIOS_H
187                         tcsetattr (0, TCSANOW, &termios);
188 #endif
189                         if (e2fsck_global_ctx &&
190                             e2fsck_global_ctx->flags & E2F_FLAG_SETJMP_OK) {
191                                 puts("\n");
192                                 longjmp(e2fsck_global_ctx->abort_loc, 1);
193                         }
194                         puts(_("cancelled!\n"));
195                         return 0;
196                 }
197                 if (strchr(short_yes, (char) c)) {
198                         def = 1;
199                         break;
200                 }
201                 else if (strchr(short_no, (char) c)) {
202                         def = 0;
203                         break;
204                 }
205                 else if ((c == 27 || c == ' ' || c == '\n') && (def != -1))
206                         break;
207         }
208         if (def)
209                 puts(_("yes\n"));
210         else
211                 puts (_("no\n"));
212 #ifdef HAVE_TERMIOS_H
213         tcsetattr (0, TCSANOW, &termios);
214 #endif
215         return def;
216 }
217
218 int ask (e2fsck_t ctx, const char * string, int def)
219 {
220         if (ctx->options & E2F_OPT_NO) {
221                 printf (_("%s? no\n\n"), string);
222                 return 0;
223         }
224         if (ctx->options & E2F_OPT_YES) {
225                 printf (_("%s? yes\n\n"), string);
226                 return 1;
227         }
228         if (ctx->options & E2F_OPT_PREEN) {
229                 printf ("%s? %s\n\n", string, def ? _("yes") : _("no"));
230                 return def;
231         }
232         return ask_yn(string, def);
233 }
234
235 void e2fsck_read_bitmaps(e2fsck_t ctx)
236 {
237         ext2_filsys fs = ctx->fs;
238         errcode_t       retval;
239         const char      *old_op;
240
241         if (ctx->invalid_bitmaps) {
242                 com_err(ctx->program_name, 0,
243                     _("e2fsck_read_bitmaps: illegal bitmap block(s) for %s"),
244                         ctx->device_name);
245                 fatal_error(ctx, 0);
246         }
247
248         old_op = ehandler_operation(_("reading inode and block bitmaps"));
249         retval = ext2fs_read_bitmaps(fs);
250         ehandler_operation(old_op);
251         if (retval) {
252                 com_err(ctx->program_name, retval,
253                         _("while retrying to read bitmaps for %s"),
254                         ctx->device_name);
255                 fatal_error(ctx, 0);
256         }
257 }
258
259 void e2fsck_write_bitmaps(e2fsck_t ctx)
260 {
261         ext2_filsys fs = ctx->fs;
262         errcode_t       retval;
263         const char      *old_op;
264
265         old_op = ehandler_operation(_("writing block and inode bitmaps"));
266         retval = ext2fs_write_bitmaps(fs);
267         ehandler_operation(old_op);
268         if (retval) {
269                 com_err(ctx->program_name, retval,
270                         _("while rewriting block and inode bitmaps for %s"),
271                         ctx->device_name);
272                 fatal_error(ctx, 0);
273         }
274 }
275
276 void preenhalt(e2fsck_t ctx)
277 {
278         ext2_filsys fs = ctx->fs;
279
280         if (!(ctx->options & E2F_OPT_PREEN))
281                 return;
282         fprintf(stderr, _("\n\n%s: UNEXPECTED INCONSISTENCY; "
283                 "RUN fsck MANUALLY.\n\t(i.e., without -a or -p options)\n"),
284                ctx->device_name);
285         ctx->flags |= E2F_FLAG_EXITING;
286         if (fs != NULL) {
287                 fs->super->s_state |= EXT2_ERROR_FS;
288                 ext2fs_mark_super_dirty(fs);
289                 ext2fs_close(fs);
290         }
291         exit(FSCK_UNCORRECTED);
292 }
293
294 #ifdef RESOURCE_TRACK
295 void init_resource_track(struct resource_track *track, io_channel channel)
296 {
297 #ifdef HAVE_GETRUSAGE
298         struct rusage r;
299 #endif
300         io_stats io_start = 0;
301
302         track->brk_start = sbrk(0);
303         gettimeofday(&track->time_start, 0);
304 #ifdef HAVE_GETRUSAGE
305 #ifdef sun
306         memset(&r, 0, sizeof(struct rusage));
307 #endif
308         getrusage(RUSAGE_SELF, &r);
309         track->user_start = r.ru_utime;
310         track->system_start = r.ru_stime;
311 #else
312         track->user_start.tv_sec = track->user_start.tv_usec = 0;
313         track->system_start.tv_sec = track->system_start.tv_usec = 0;
314 #endif
315         track->bytes_read = 0;
316         track->bytes_written = 0;
317         if (channel && channel->manager && channel->manager->get_stats)
318                 channel->manager->get_stats(channel, &io_start);
319         if (io_start) {
320                 track->bytes_read = io_start->bytes_read;
321                 track->bytes_written = io_start->bytes_written;
322         }
323 }
324
325 #ifdef __GNUC__
326 #define _INLINE_ __inline__
327 #else
328 #define _INLINE_
329 #endif
330
331 static _INLINE_ float timeval_subtract(struct timeval *tv1,
332                                        struct timeval *tv2)
333 {
334         return ((tv1->tv_sec - tv2->tv_sec) +
335                 ((float) (tv1->tv_usec - tv2->tv_usec)) / 1000000);
336 }
337
338 void print_resource_track(e2fsck_t ctx, const char *desc,
339                           struct resource_track *track, io_channel channel)
340 {
341 #ifdef HAVE_GETRUSAGE
342         struct rusage r;
343 #endif
344 #ifdef HAVE_MALLINFO
345         struct mallinfo malloc_info;
346 #endif
347         struct timeval time_end;
348
349         if ((desc && !(ctx->options & E2F_OPT_TIME2)) ||
350             (!desc && !(ctx->options & E2F_OPT_TIME)))
351                 return;
352
353         e2fsck_clear_progbar(ctx);
354         gettimeofday(&time_end, 0);
355
356         if (desc)
357                 printf("%s: ", desc);
358
359 #ifdef HAVE_MALLINFO
360 #define kbytes(x)       (((unsigned long)(x) + 1023) / 1024)
361
362         malloc_info = mallinfo();
363         printf(_("Memory used: %luk/%luk (%luk/%luk), "),
364                kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd),
365                kbytes(malloc_info.uordblks), kbytes(malloc_info.fordblks));
366 #else
367         printf(_("Memory used: %lu, "),
368                (unsigned long) (((char *) sbrk(0)) - 
369                                 ((char *) track->brk_start)));
370 #endif
371 #ifdef HAVE_GETRUSAGE
372         getrusage(RUSAGE_SELF, &r);
373
374         printf(_("time: %5.2f/%5.2f/%5.2f\n"),
375                timeval_subtract(&time_end, &track->time_start),
376                timeval_subtract(&r.ru_utime, &track->user_start),
377                timeval_subtract(&r.ru_stime, &track->system_start));
378 #else
379         printf(_("elapsed time: %6.3f\n"),
380                timeval_subtract(&time_end, &track->time_start));
381 #endif
382 #define mbytes(x)       (((x) + 1048575) / 1048576)
383         if (channel && channel->manager && channel->manager->get_stats) {
384                 io_stats delta = 0;
385                 unsigned long long bytes_read = 0;
386                 unsigned long long bytes_written = 0;
387
388                 if (desc)
389                         printf("%s: ", desc);
390
391                 channel->manager->get_stats(channel, &delta);
392                 if (delta) {
393                         bytes_read = delta->bytes_read - track->bytes_read;
394                         bytes_written = delta->bytes_written -
395                                 track->bytes_written;
396                 }
397                 printf("I/O read: %lluMB, write: %lluMB, rate: %.2fMB/s\n",
398                        mbytes(bytes_read), mbytes(bytes_written),
399                        (double)mbytes(bytes_read + bytes_written) /
400                        timeval_subtract(&time_end, &track->time_start));
401         }
402 }
403 #endif /* RESOURCE_TRACK */
404
405 void e2fsck_read_inode(e2fsck_t ctx, unsigned long ino,
406                               struct ext2_inode * inode, const char *proc)
407 {
408         int retval;
409
410         retval = ext2fs_read_inode(ctx->fs, ino, inode);
411         if (retval) {
412                 com_err("ext2fs_read_inode", retval,
413                         _("while reading inode %lu in %s"), ino, proc);
414                 fatal_error(ctx, 0);
415         }
416 }
417
418 void e2fsck_read_inode_full(e2fsck_t ctx, unsigned long ino,
419                             struct ext2_inode *inode, int bufsize,
420                             const char *proc)
421 {
422         int retval;
423
424         retval = ext2fs_read_inode_full(ctx->fs, ino, inode, bufsize);
425         if (retval) {
426                 com_err("ext2fs_read_inode_full", retval,
427                         _("while reading inode %lu in %s"), ino, proc);
428                 fatal_error(ctx, 0);
429         }
430 }
431
432 extern void e2fsck_write_inode_full(e2fsck_t ctx, unsigned long ino,
433                                struct ext2_inode * inode, int bufsize,
434                                const char *proc)
435 {
436         int retval;
437
438         retval = ext2fs_write_inode_full(ctx->fs, ino, inode, bufsize);
439         if (retval) {
440                 com_err("ext2fs_write_inode", retval,
441                         _("while writing inode %lu in %s"), ino, proc);
442                 fatal_error(ctx, 0);
443         }
444 }
445
446 extern void e2fsck_write_inode(e2fsck_t ctx, unsigned long ino,
447                                struct ext2_inode * inode, const char *proc)
448 {
449         int retval;
450
451         retval = ext2fs_write_inode(ctx->fs, ino, inode);
452         if (retval) {
453                 com_err("ext2fs_write_inode", retval,
454                         _("while writing inode %lu in %s"), ino, proc);
455                 fatal_error(ctx, 0);
456         }
457 }
458
459 #ifdef MTRACE
460 void mtrace_print(char *mesg)
461 {
462         FILE    *malloc_get_mallstream();
463         FILE    *f = malloc_get_mallstream();
464
465         if (f)
466                 fprintf(f, "============= %s\n", mesg);
467 }
468 #endif
469
470 blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs, const char *name,
471                    io_manager manager)
472 {
473         struct ext2_super_block *sb;
474         io_channel              io = NULL;
475         void                    *buf = NULL;
476         int                     blocksize;
477         blk_t                   superblock, ret_sb = 8193;
478
479         if (fs && fs->super) {
480                 ret_sb = (fs->super->s_blocks_per_group +
481                           fs->super->s_first_data_block);
482                 if (ctx) {
483                         ctx->superblock = ret_sb;
484                         ctx->blocksize = fs->blocksize;
485                 }
486                 return ret_sb;
487         }
488
489         if (ctx) {
490                 if (ctx->blocksize) {
491                         ret_sb = ctx->blocksize * 8;
492                         if (ctx->blocksize == 1024)
493                                 ret_sb++;
494                         ctx->superblock = ret_sb;
495                         return ret_sb;
496                 }
497                 ctx->superblock = ret_sb;
498                 ctx->blocksize = 1024;
499         }
500
501         if (!name || !manager)
502                 goto cleanup;
503
504         if (manager->open(name, 0, &io) != 0)
505                 goto cleanup;
506
507         if (ext2fs_get_mem(SUPERBLOCK_SIZE, &buf))
508                 goto cleanup;
509         sb = (struct ext2_super_block *) buf;
510
511         for (blocksize = EXT2_MIN_BLOCK_SIZE;
512              blocksize <= EXT2_MAX_BLOCK_SIZE ; blocksize *= 2) {
513                 superblock = blocksize*8;
514                 if (blocksize == 1024)
515                         superblock++;
516                 io_channel_set_blksize(io, blocksize);
517                 if (io_channel_read_blk64(io, superblock,
518                                         -SUPERBLOCK_SIZE, buf))
519                         continue;
520 #ifdef WORDS_BIGENDIAN
521                 if (sb->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
522                         ext2fs_swap_super(sb);
523 #endif
524                 if ((sb->s_magic == EXT2_SUPER_MAGIC) &&
525                     (EXT2_BLOCK_SIZE(sb) == blocksize)) {
526                         ret_sb = superblock;
527                         if (ctx) {
528                                 ctx->superblock = superblock;
529                                 ctx->blocksize = blocksize;
530                         }
531                         break;
532                 }
533         }
534
535 cleanup:
536         if (io)
537                 io_channel_close(io);
538         if (buf)
539                 ext2fs_free_mem(&buf);
540         return (ret_sb);
541 }
542
543 /*
544  * Given a mode, return the ext2 file type
545  */
546 int ext2_file_type(unsigned int mode)
547 {
548         if (LINUX_S_ISREG(mode))
549                 return EXT2_FT_REG_FILE;
550
551         if (LINUX_S_ISDIR(mode))
552                 return EXT2_FT_DIR;
553
554         if (LINUX_S_ISCHR(mode))
555                 return EXT2_FT_CHRDEV;
556
557         if (LINUX_S_ISBLK(mode))
558                 return EXT2_FT_BLKDEV;
559
560         if (LINUX_S_ISLNK(mode))
561                 return EXT2_FT_SYMLINK;
562
563         if (LINUX_S_ISFIFO(mode))
564                 return EXT2_FT_FIFO;
565
566         if (LINUX_S_ISSOCK(mode))
567                 return EXT2_FT_SOCK;
568
569         return 0;
570 }
571
572 #define STRIDE_LENGTH 8
573 /*
574  * Helper function which zeros out _num_ blocks starting at _blk_.  In
575  * case of an error, the details of the error is returned via _ret_blk_
576  * and _ret_count_ if they are non-NULL pointers.  Returns 0 on
577  * success, and an error code on an error.
578  *
579  * As a special case, if the first argument is NULL, then it will
580  * attempt to free the static zeroizing buffer.  (This is to keep
581  * programs that check for memory leaks happy.)
582  */
583 errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num,
584                              blk_t *ret_blk, int *ret_count)
585 {
586         int             j, count, next_update, next_update_incr;
587         static char     *buf;
588         errcode_t       retval;
589
590         /* If fs is null, clean up the static buffer and return */
591         if (!fs) {
592                 if (buf) {
593                         free(buf);
594                         buf = 0;
595                 }
596                 return 0;
597         }
598         /* Allocate the zeroizing buffer if necessary */
599         if (!buf) {
600                 buf = malloc(fs->blocksize * STRIDE_LENGTH);
601                 if (!buf) {
602                         com_err("malloc", ENOMEM,
603                                 _("while allocating zeroizing buffer"));
604                         exit(1);
605                 }
606                 memset(buf, 0, fs->blocksize * STRIDE_LENGTH);
607         }
608         /* OK, do the write loop */
609         next_update = 0;
610         next_update_incr = num / 100;
611         if (next_update_incr < 1)
612                 next_update_incr = 1;
613         for (j = 0; j < num; j += STRIDE_LENGTH, blk += STRIDE_LENGTH) {
614                 count = num - j;
615                 if (count > STRIDE_LENGTH)
616                         count = STRIDE_LENGTH;
617                 retval = io_channel_write_blk64(fs->io, blk, count, buf);
618                 if (retval) {
619                         if (ret_count)
620                                 *ret_count = count;
621                         if (ret_blk)
622                                 *ret_blk = blk;
623                         return retval;
624                 }
625         }
626         return 0;
627 }
628
629 /*
630  * Check to see if a filesystem is in /proc/filesystems.
631  * Returns 1 if found, 0 if not
632  */
633 int fs_proc_check(const char *fs_name)
634 {
635         FILE    *f;
636         char    buf[80], *cp, *t;
637
638         f = fopen("/proc/filesystems", "r");
639         if (!f)
640                 return (0);
641         while (!feof(f)) {
642                 if (!fgets(buf, sizeof(buf), f))
643                         break;
644                 cp = buf;
645                 if (!isspace(*cp)) {
646                         while (*cp && !isspace(*cp))
647                                 cp++;
648                 }
649                 while (*cp && isspace(*cp))
650                         cp++;
651                 if ((t = strchr(cp, '\n')) != NULL)
652                         *t = 0;
653                 if ((t = strchr(cp, '\t')) != NULL)
654                         *t = 0;
655                 if ((t = strchr(cp, ' ')) != NULL)
656                         *t = 0;
657                 if (!strcmp(fs_name, cp)) {
658                         fclose(f);
659                         return (1);
660                 }
661         }
662         fclose(f);
663         return (0);
664 }
665
666 /*
667  * Check to see if a filesystem is available as a module
668  * Returns 1 if found, 0 if not
669  */
670 int check_for_modules(const char *fs_name)
671 {
672 #ifdef __linux__
673         struct utsname  uts;
674         FILE            *f;
675         char            buf[1024], *cp, *t;
676         int             i;
677
678         if (uname(&uts))
679                 return (0);
680         snprintf(buf, sizeof(buf), "/lib/modules/%s/modules.dep", uts.release);
681
682         f = fopen(buf, "r");
683         if (!f)
684                 return (0);
685         while (!feof(f)) {
686                 if (!fgets(buf, sizeof(buf), f))
687                         break;
688                 if ((cp = strchr(buf, ':')) != NULL)
689                         *cp = 0;
690                 else
691                         continue;
692                 if ((cp = strrchr(buf, '/')) != NULL)
693                         cp++;
694                 else
695                         cp = buf;
696                 i = strlen(cp);
697                 if (i > 3) {
698                         t = cp + i - 3;
699                         if (!strcmp(t, ".ko"))
700                                 *t = 0;
701                 }
702                 if (!strcmp(cp, fs_name)) {
703                         fclose(f);
704                         return (1);
705                 }
706         }
707         fclose(f);
708 #endif /* __linux__ */
709         return (0);
710 }
711
712 /*
713  * Helper function that does the right thing if write returns a
714  * partial write, or an EGAIN/EINTR error.
715  */
716 int write_all(int fd, char *buf, size_t count)
717 {
718         ssize_t ret;
719         int c = 0;
720
721         while (count > 0) {
722                 ret = write(fd, buf, count);
723                 if (ret < 0) {
724                         if ((errno == EAGAIN) || (errno == EINTR))
725                                 continue;
726                         return -1;
727                 }
728                 count -= ret;
729                 buf += ret;
730                 c += ret;
731         }
732         return c;
733 }
734
735 void dump_mmp_msg(struct mmp_struct *mmp, const char *msg)
736 {
737
738         if (msg)
739                 printf("MMP check failed: %s\n", msg);
740         if (mmp) {
741                 time_t t = mmp->mmp_time;
742
743                 printf("MMP error info: last update: %s node: %s device: %s\n",
744                        ctime(&t), mmp->mmp_nodename, mmp->mmp_bdevname);
745         }
746 }
747
748 errcode_t e2fsck_mmp_update(ext2_filsys fs)
749 {
750         errcode_t retval;
751
752         retval = ext2fs_mmp_update(fs);
753         if (retval == EXT2_ET_MMP_CHANGE_ABORT)
754                 dump_mmp_msg(fs->mmp_cmp,
755                              _("UNEXPECTED INCONSISTENCY: the filesystem is "
756                                "being modified while fsck is running.\n"));
757
758         return retval;
759 }