2 * tune2fs.c - Change the file system parameters on an ext2 file system
4 * Copyright (C) 1992, 1993, 1994 Remy Card <card@masi.ibp.fr>
5 * Laboratoire MASI, Institut Blaise Pascal
6 * Universite Pierre et Marie Curie (Paris VI)
8 * Copyright 1995, 1996, 1997, 1998, 1999, 2000 by Theodore Ts'o.
11 * This file may be redistributed under the terms of the GNU Public
19 * 93/10/31 - Added the -c option to change the maximal mount counts
20 * 93/12/14 - Added -l flag to list contents of superblock
21 * M.J.E. Mol (marcel@duteca.et.tudelft.nl)
22 * F.W. ten Wolde (franky@duteca.et.tudelft.nl)
23 * 93/12/29 - Added the -e option to change errors behavior
24 * 94/02/27 - Ported to use the ext2fs library
25 * 94/03/06 - Added the checks interval from Uwe Ohse (uwe@tirka.gun.de)
28 #define _XOPEN_SOURCE 500 /* for inclusion of strptime() */
29 #define _BSD_SOURCE /* for inclusion of strcasecmp() */
44 #include <sys/types.h>
46 #include "ext2fs/ext2_fs.h"
47 #include "ext2fs/ext2fs.h"
48 #include "et/com_err.h"
49 #include "uuid/uuid.h"
53 #include "blkid/blkid.h"
55 #include "../version.h"
56 #include "nls-enable.h"
58 const char * program_name = "tune2fs";
60 char * new_label, *new_last_mounted, *new_UUID;
62 static int c_flag, C_flag, e_flag, f_flag, g_flag, i_flag, l_flag, L_flag;
63 static int m_flag, M_flag, r_flag, s_flag = -1, u_flag, U_flag, T_flag;
64 static time_t last_check_time;
65 static int print_label;
66 static int max_mount_count, mount_count, mount_flags;
67 static unsigned long interval, reserved_ratio, reserved_blocks;
68 static unsigned long resgid, resuid;
69 static unsigned short errors;
71 static char *features_cmd;
72 static char *mntopts_cmd;
74 int journal_size, journal_flags;
77 static const char *please_fsck = N_("Please run e2fsck on the filesystem.\n");
79 void do_findfs(int argc, char **argv);
81 static void usage(void)
84 _("Usage: %s [-c max-mounts-count] [-e errors-behavior] "
86 "\t[-i interval[d|m|w]] [-j] [-J journal-options]\n"
87 "\t[-l] [-s sparse-flag] [-m reserved-blocks-percent]\n"
88 "\t[-o [^]mount-options[,...]] [-r reserved-blocks-count]\n"
89 "\t[-u user] [-C mount-count] [-L volume-label] "
90 "[-M last-mounted-dir]\n"
91 "\t[-O [^]feature[,...]] [-T last-check-time] [-U UUID]"
92 " device\n"), program_name);
96 static __u32 ok_features[3] = {
97 EXT3_FEATURE_COMPAT_HAS_JOURNAL |
98 EXT2_FEATURE_COMPAT_DIR_INDEX, /* Compat */
99 EXT2_FEATURE_INCOMPAT_FILETYPE, /* Incompat */
100 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER /* R/O compat */
104 * Remove an external journal from the filesystem
106 static void remove_journal_device(ext2_filsys fs)
111 journal_superblock_t *jsb;
114 int commit_remove_journal = 0;
118 commit_remove_journal = 1; /* force removal even if error */
120 uuid_unparse(fs->super->s_journal_uuid, buf);
121 journal_path = blkid_get_devname(NULL, "UUID", buf);
125 ext2fs_find_block_device(fs->super->s_journal_dev);
130 #ifdef CONFIG_TESTIO_DEBUG
131 io_ptr = test_io_manager;
132 test_io_backing_manager = unix_io_manager;
134 io_ptr = unix_io_manager;
136 retval = ext2fs_open(journal_path, EXT2_FLAG_RW|
137 EXT2_FLAG_JOURNAL_DEV_OK, 0,
138 fs->blocksize, io_ptr, &jfs);
140 com_err(program_name, retval,
141 _("while trying to open external journal"));
142 goto no_valid_journal;
144 if (!(jfs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) {
145 fprintf(stderr, _("%s is not a journal device.\n"),
147 goto no_valid_journal;
150 /* Get the journal superblock */
151 if ((retval = io_channel_read_blk(jfs->io, 1, -1024, buf))) {
152 com_err(program_name, retval,
153 _("while reading journal superblock"));
154 goto no_valid_journal;
157 jsb = (journal_superblock_t *) buf;
158 if ((jsb->s_header.h_magic != (unsigned) ntohl(JFS_MAGIC_NUMBER)) ||
159 (jsb->s_header.h_blocktype != (unsigned) ntohl(JFS_SUPERBLOCK_V2))) {
160 fputs(_("Journal superblock not found!\n"), stderr);
161 goto no_valid_journal;
164 /* Find the filesystem UUID */
165 nr_users = ntohl(jsb->s_nr_users);
166 for (i=0; i < nr_users; i++) {
167 if (memcmp(fs->super->s_uuid,
168 &jsb->s_users[i*16], 16) == 0)
172 fputs(_("Filesystem's UUID not found on journal device.\n"),
174 commit_remove_journal = 1;
175 goto no_valid_journal;
178 for (i=0; i < nr_users; i++)
179 memcpy(&jsb->s_users[i*16], &jsb->s_users[(i+1)*16], 16);
180 jsb->s_nr_users = htonl(nr_users);
182 /* Write back the journal superblock */
183 if ((retval = io_channel_write_blk(jfs->io, 1, -1024, buf))) {
184 com_err(program_name, retval,
185 "while writing journal superblock.");
186 goto no_valid_journal;
189 commit_remove_journal = 1;
192 if (commit_remove_journal == 0) {
193 fputs(_("Journal NOT removed\n"), stderr);
196 fs->super->s_journal_dev = 0;
197 uuid_clear(fs->super->s_journal_uuid);
198 ext2fs_mark_super_dirty(fs);
199 fputs(_("Journal removed\n"), stdout);
203 /* Helper function for remove_journal_inode */
204 static int release_blocks_proc(ext2_filsys fs, blk_t *blocknr,
205 int blockcnt EXT2FS_ATTR((unused)),
206 void *private EXT2FS_ATTR((unused)))
212 ext2fs_unmark_block_bitmap(fs->block_map,block);
213 group = ext2fs_group_of_blk(fs, block);
214 fs->group_desc[group].bg_free_blocks_count++;
215 fs->super->s_free_blocks_count++;
220 * Remove the journal inode from the filesystem
222 static void remove_journal_inode(ext2_filsys fs)
224 struct ext2_inode inode;
226 ino_t ino = fs->super->s_journal_inum;
228 retval = ext2fs_read_inode(fs, ino, &inode);
230 com_err(program_name, retval,
231 _("while reading journal inode"));
234 if (ino == EXT2_JOURNAL_INO) {
235 retval = ext2fs_read_bitmaps(fs);
237 com_err(program_name, retval,
238 _("while reading bitmaps"));
241 retval = ext2fs_block_iterate(fs, ino, 0, NULL,
242 release_blocks_proc, NULL);
244 com_err(program_name, retval,
245 _("while clearing journal inode"));
248 memset(&inode, 0, sizeof(inode));
249 ext2fs_mark_bb_dirty(fs);
250 fs->flags &= ~EXT2_FLAG_SUPER_ONLY;
252 inode.i_flags &= ~EXT2_IMMUTABLE_FL;
253 retval = ext2fs_write_inode(fs, ino, &inode);
255 com_err(program_name, retval,
256 _("while writing journal inode"));
259 fs->super->s_journal_inum = 0;
260 ext2fs_mark_super_dirty(fs);
264 * Update the default mount options
266 static void update_mntopts(ext2_filsys fs, char *mntopts)
268 struct ext2_super_block *sb= fs->super;
270 if (e2p_edit_mntopts(mntopts, &sb->s_default_mount_opts, ~0)) {
271 fprintf(stderr, _("Invalid mount option set: %s\n"),
275 ext2fs_mark_super_dirty(fs);
279 * Update the feature set as provided by the user.
281 static void update_feature_set(ext2_filsys fs, char *features)
283 int sparse, old_sparse, filetype, old_filetype;
284 int journal, old_journal, dxdir, old_dxdir;
285 struct ext2_super_block *sb= fs->super;
286 __u32 old_compat, old_incompat, old_ro_compat;
288 old_compat = sb->s_feature_compat;
289 old_ro_compat = sb->s_feature_ro_compat;
290 old_incompat = sb->s_feature_incompat;
292 old_sparse = sb->s_feature_ro_compat &
293 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
294 old_filetype = sb->s_feature_incompat &
295 EXT2_FEATURE_INCOMPAT_FILETYPE;
296 old_journal = sb->s_feature_compat &
297 EXT3_FEATURE_COMPAT_HAS_JOURNAL;
298 old_dxdir = sb->s_feature_compat &
299 EXT2_FEATURE_COMPAT_DIR_INDEX;
300 if (e2p_edit_feature(features, &sb->s_feature_compat,
302 fprintf(stderr, _("Invalid filesystem option set: %s\n"),
306 sparse = sb->s_feature_ro_compat &
307 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
308 filetype = sb->s_feature_incompat &
309 EXT2_FEATURE_INCOMPAT_FILETYPE;
310 journal = sb->s_feature_compat &
311 EXT3_FEATURE_COMPAT_HAS_JOURNAL;
312 dxdir = sb->s_feature_compat &
313 EXT2_FEATURE_COMPAT_DIR_INDEX;
314 if (old_journal && !journal) {
315 if ((mount_flags & EXT2_MF_MOUNTED) &&
316 !(mount_flags & EXT2_MF_READONLY)) {
317 fputs(_("The has_journal flag may only be "
318 "cleared when the filesystem is\n"
319 "unmounted or mounted "
320 "read-only.\n"), stderr);
323 if (sb->s_feature_incompat &
324 EXT3_FEATURE_INCOMPAT_RECOVER) {
325 fputs(_("The needs_recovery flag is set. "
326 "Please run e2fsck before clearing\n"
327 "the has_journal flag.\n"), stderr);
330 if (sb->s_journal_inum) {
331 remove_journal_inode(fs);
333 if (sb->s_journal_dev) {
334 remove_journal_device(fs);
337 if (journal && !old_journal) {
339 * If adding a journal flag, let the create journal
340 * code below handle creating setting the flag and
341 * creating the journal. We supply a default size if
346 sb->s_feature_compat &= ~EXT3_FEATURE_COMPAT_HAS_JOURNAL;
348 if (dxdir && !old_dxdir) {
349 if (!sb->s_def_hash_version)
350 sb->s_def_hash_version = EXT2_HASH_TEA;
351 if (uuid_is_null((unsigned char *) sb->s_hash_seed))
352 uuid_generate((unsigned char *) sb->s_hash_seed);
355 if (sb->s_rev_level == EXT2_GOOD_OLD_REV &&
356 (sb->s_feature_compat || sb->s_feature_ro_compat ||
357 sb->s_feature_incompat))
358 ext2fs_update_dynamic_rev(fs);
359 if ((sparse != old_sparse) ||
360 (filetype != old_filetype)) {
361 sb->s_state &= ~EXT2_VALID_FS;
362 printf("\n%s\n", _(please_fsck));
364 if ((old_compat != sb->s_feature_compat) ||
365 (old_ro_compat != sb->s_feature_ro_compat) ||
366 (old_incompat != sb->s_feature_incompat))
367 ext2fs_mark_super_dirty(fs);
371 * Add a journal to the filesystem.
373 static void add_journal(ext2_filsys fs)
375 unsigned long journal_blocks;
380 if (fs->super->s_feature_compat &
381 EXT3_FEATURE_COMPAT_HAS_JOURNAL) {
382 fputs(_("The filesystem already has a journal.\n"), stderr);
385 if (journal_device) {
386 check_plausibility(journal_device);
387 check_mount(journal_device, 0, _("journal"));
388 #ifdef CONFIG_TESTIO_DEBUG
389 io_ptr = test_io_manager;
390 test_io_backing_manager = unix_io_manager;
392 io_ptr = unix_io_manager;
394 retval = ext2fs_open(journal_device, EXT2_FLAG_RW|
395 EXT2_FLAG_JOURNAL_DEV_OK, 0,
396 fs->blocksize, io_ptr, &jfs);
398 com_err(program_name, retval,
399 _("\n\twhile trying to open journal on %s\n"),
403 printf(_("Creating journal on device %s: "),
407 retval = ext2fs_add_journal_device(fs, jfs);
410 com_err (program_name, retval,
411 _("while adding filesystem to journal on %s"),
415 fputs(_("done\n"), stdout);
416 } else if (journal_size) {
417 fputs(_("Creating journal inode: "), stdout);
419 journal_blocks = figure_journal_size(journal_size, fs);
421 retval = ext2fs_add_journal_inode(fs, journal_blocks,
424 fprintf(stderr, "\n");
425 com_err(program_name, retval,
426 _("\n\twhile trying to create journal file"));
429 fputs(_("done\n"), stdout);
431 * If the filesystem wasn't mounted, we need to force
432 * the block group descriptors out.
434 if ((mount_flags & EXT2_MF_MOUNTED) == 0)
435 fs->flags &= ~EXT2_FLAG_SUPER_ONLY;
437 print_check_message(fs);
442 free(journal_device);
447 static void parse_e2label_options(int argc, char ** argv)
449 if ((argc < 2) || (argc > 3)) {
450 fputs(_("Usage: e2label device [newlabel]\n"), stderr);
453 io_options = strchr(argv[1], '?');
456 device_name = blkid_get_devname(NULL, argv[1], NULL);
458 com_err("e2label", 0, _("Unable to resolve '%s'"),
463 open_flag = EXT2_FLAG_RW | EXT2_FLAG_JOURNAL_DEV_OK;
470 static time_t parse_time(char *str)
474 if (strcmp(str, "now") == 0) {
477 memset(&ts, 0, sizeof(ts));
479 strptime(str, "%Y%m%d%H%M%S", &ts);
481 sscanf(str, "%4d%2d%2d%2d%2d%2d", &ts.tm_year, &ts.tm_mon,
482 &ts.tm_mday, &ts.tm_hour, &ts.tm_min, &ts.tm_sec);
485 if (ts.tm_year < 0 || ts.tm_mon < 0 || ts.tm_mon > 11 ||
486 ts.tm_mday < 0 || ts.tm_mday > 31 || ts.tm_hour > 23 ||
487 ts.tm_min > 59 || ts.tm_sec > 61)
490 if (ts.tm_mday == 0) {
491 com_err(program_name, 0,
492 _("Couldn't parse date/time specifier: %s"),
496 return (mktime(&ts));
499 static void parse_tune2fs_options(int argc, char **argv)
506 printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE);
507 while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:J:L:M:O:T:U:")) != EOF)
511 max_mount_count = strtol (optarg, &tmp, 0);
512 if (*tmp || max_mount_count > 16000) {
513 com_err (program_name, 0,
514 _("bad mounts count - %s"),
518 if (max_mount_count == 0)
519 max_mount_count = -1;
521 open_flag = EXT2_FLAG_RW;
524 mount_count = strtoul (optarg, &tmp, 0);
525 if (*tmp || mount_count > 16000) {
526 com_err (program_name, 0,
527 _("bad mounts count - %s"),
532 open_flag = EXT2_FLAG_RW;
535 if (strcmp (optarg, "continue") == 0)
536 errors = EXT2_ERRORS_CONTINUE;
537 else if (strcmp (optarg, "remount-ro") == 0)
538 errors = EXT2_ERRORS_RO;
539 else if (strcmp (optarg, "panic") == 0)
540 errors = EXT2_ERRORS_PANIC;
542 com_err (program_name, 0,
543 _("bad error behavior - %s"),
548 open_flag = EXT2_FLAG_RW;
550 case 'f': /* Force */
554 resgid = strtoul (optarg, &tmp, 0);
556 gr = getgrnam (optarg);
565 com_err (program_name, 0,
566 _("bad gid/group name - %s"),
571 open_flag = EXT2_FLAG_RW;
574 interval = strtoul (optarg, &tmp, 0);
587 case 'M': /* months! */
588 interval *= 86400 * 30;
592 case 'W': /* weeks */
593 interval *= 86400 * 7;
597 if (*tmp || interval > (365 * 86400)) {
598 com_err (program_name, 0,
599 _("bad interval - %s"), optarg);
603 open_flag = EXT2_FLAG_RW;
608 open_flag = EXT2_FLAG_RW;
611 parse_journal_opts(optarg);
612 open_flag = EXT2_FLAG_RW;
620 open_flag = EXT2_FLAG_RW |
621 EXT2_FLAG_JOURNAL_DEV_OK;
624 reserved_ratio = strtoul (optarg, &tmp, 0);
625 if (*tmp || reserved_ratio > 50) {
626 com_err (program_name, 0,
627 _("bad reserved block ratio - %s"),
632 open_flag = EXT2_FLAG_RW;
635 new_last_mounted = optarg;
637 open_flag = EXT2_FLAG_RW;
641 com_err (program_name, 0,
642 _("-o may only be specified once"));
645 mntopts_cmd = optarg;
646 open_flag = EXT2_FLAG_RW;
651 com_err (program_name, 0,
652 _("-O may only be specified once"));
655 features_cmd = optarg;
656 open_flag = EXT2_FLAG_RW;
659 reserved_blocks = strtoul (optarg, &tmp, 0);
661 com_err (program_name, 0,
662 _("bad reserved blocks count - %s"),
667 open_flag = EXT2_FLAG_RW;
670 s_flag = atoi(optarg);
671 open_flag = EXT2_FLAG_RW;
675 last_check_time = parse_time(optarg);
676 open_flag = EXT2_FLAG_RW;
679 resuid = strtoul (optarg, &tmp, 0);
681 pw = getpwnam (optarg);
690 com_err (program_name, 0,
691 _("bad uid/user name - %s"),
696 open_flag = EXT2_FLAG_RW;
701 open_flag = EXT2_FLAG_RW |
702 EXT2_FLAG_JOURNAL_DEV_OK;
707 if (optind < argc - 1 || optind == argc)
709 if (!open_flag && !l_flag)
711 io_options = strchr(argv[optind], '?');
714 device_name = blkid_get_devname(NULL, argv[optind], NULL);
716 com_err("tune2fs", 0, _("Unable to resolve '%s'"),
722 void do_findfs(int argc, char **argv)
727 (strncmp(argv[1], "LABEL=", 6) && strncmp(argv[1], "UUID=", 5))) {
728 fprintf(stderr, "Usage: findfs LABEL=<label>|UUID=<uuid>\n");
731 dev = blkid_get_devname(NULL, argv[1], NULL);
733 com_err("findfs", 0, _("Unable to resolve '%s'"),
742 int main (int argc, char ** argv)
746 struct ext2_super_block *sb;
750 setlocale(LC_MESSAGES, "");
751 setlocale(LC_CTYPE, "");
752 bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
753 textdomain(NLS_CAT_NAME);
756 program_name = *argv;
757 initialize_ext2_error_table();
759 if (strcmp(get_progname(argv[0]), "findfs") == 0)
760 do_findfs(argc, argv);
761 if (strcmp(get_progname(argv[0]), "e2label") == 0)
762 parse_e2label_options(argc, argv);
764 parse_tune2fs_options(argc, argv);
766 #ifdef CONFIG_TESTIO_DEBUG
767 io_ptr = test_io_manager;
768 test_io_backing_manager = unix_io_manager;
770 io_ptr = unix_io_manager;
772 retval = ext2fs_open2(device_name, io_options, open_flag,
775 com_err (program_name, retval, _("while trying to open %s"),
778 _("Couldn't find valid filesystem superblock.\n"));
783 /* For e2label emulation */
784 printf("%.*s\n", (int) sizeof(sb->s_volume_name),
788 retval = ext2fs_check_if_mounted(device_name, &mount_flags);
790 com_err("ext2fs_check_if_mount", retval,
791 _("while determining whether %s is mounted."),
795 /* Normally we only need to write out the superblock */
796 fs->flags |= EXT2_FLAG_SUPER_ONLY;
799 sb->s_max_mnt_count = max_mount_count;
800 ext2fs_mark_super_dirty(fs);
801 printf (_("Setting maximal mount count to %d\n"),
805 sb->s_mnt_count = mount_count;
806 ext2fs_mark_super_dirty(fs);
807 printf (_("Setting current mount count to %d\n"), mount_count);
810 sb->s_errors = errors;
811 ext2fs_mark_super_dirty(fs);
812 printf (_("Setting error behavior to %d\n"), errors);
815 sb->s_def_resgid = resgid;
816 ext2fs_mark_super_dirty(fs);
817 printf (_("Setting reserved blocks gid to %lu\n"), resgid);
820 sb->s_checkinterval = interval;
821 ext2fs_mark_super_dirty(fs);
822 printf (_("Setting interval between check %lu seconds\n"), interval);
825 sb->s_r_blocks_count = (sb->s_blocks_count / 100)
827 ext2fs_mark_super_dirty(fs);
828 printf (_("Setting reserved blocks percentage to %lu (%u blocks)\n"),
829 reserved_ratio, sb->s_r_blocks_count);
832 if (reserved_blocks >= sb->s_blocks_count/2) {
833 com_err (program_name, 0,
834 _("reserved blocks count is too big (%lu)"),
838 sb->s_r_blocks_count = reserved_blocks;
839 ext2fs_mark_super_dirty(fs);
840 printf (_("Setting reserved blocks count to %lu\n"),
844 if (sb->s_feature_ro_compat &
845 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)
846 fputs(_("\nThe filesystem already has sparse "
847 "superblocks.\n"), stderr);
849 sb->s_feature_ro_compat |=
850 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
851 sb->s_state &= ~EXT2_VALID_FS;
852 ext2fs_mark_super_dirty(fs);
853 printf(_("\nSparse superblock flag set. %s"),
858 if (!(sb->s_feature_ro_compat &
859 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER))
860 fputs(_("\nThe filesystem already has sparse "
861 "superblocks disabled.\n"), stderr);
863 sb->s_feature_ro_compat &=
864 ~EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
865 sb->s_state &= ~EXT2_VALID_FS;
866 fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
867 ext2fs_mark_super_dirty(fs);
868 printf(_("\nSparse superblock flag cleared. %s"),
873 sb->s_lastcheck = last_check_time;
874 ext2fs_mark_super_dirty(fs);
875 printf(_("Setting time filesystem last checked to %s\n"),
876 ctime(&last_check_time));
879 sb->s_def_resuid = resuid;
880 ext2fs_mark_super_dirty(fs);
881 printf (_("Setting reserved blocks uid to %lu\n"), resuid);
884 if (strlen(new_label) > sizeof(sb->s_volume_name))
885 fputs(_("Warning: label too long, truncating.\n"),
887 memset(sb->s_volume_name, 0, sizeof(sb->s_volume_name));
888 strncpy(sb->s_volume_name, new_label,
889 sizeof(sb->s_volume_name));
890 ext2fs_mark_super_dirty(fs);
893 memset(sb->s_last_mounted, 0, sizeof(sb->s_last_mounted));
894 strncpy(sb->s_last_mounted, new_last_mounted,
895 sizeof(sb->s_last_mounted));
896 ext2fs_mark_super_dirty(fs);
899 update_mntopts(fs, mntopts_cmd);
901 update_feature_set(fs, features_cmd);
902 if (journal_size || journal_device)
906 if ((strcasecmp(new_UUID, "null") == 0) ||
907 (strcasecmp(new_UUID, "clear") == 0)) {
908 uuid_clear(sb->s_uuid);
909 } else if (strcasecmp(new_UUID, "time") == 0) {
910 uuid_generate_time(sb->s_uuid);
911 } else if (strcasecmp(new_UUID, "random") == 0) {
912 uuid_generate(sb->s_uuid);
913 } else if (uuid_parse(new_UUID, sb->s_uuid)) {
914 com_err(program_name, 0, _("Invalid UUID format\n"));
917 ext2fs_mark_super_dirty(fs);
922 return (ext2fs_close (fs) ? 1 : 0);