~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to e2fsck/unix.c

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2012-06-14 13:01:21 UTC
  • mfrom: (8.4.18 sid)
  • Revision ID: package-import@ubuntu.com-20120614130121-t2gct0d09jepx0y6
Tags: 1.42.4-3ubuntu1
* Merge from Debian unstable (LP: #978012), remainging changes:
  - debian/control.in: 
      Build-depend on gettext:any instead of on gettext for (cross-building)
      Drop build dependency on dc, which hasn't been needed for some time.
      Update maintainer field.
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
  - debian/control:
      Regenerate with ./debian/rules debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
         * filesystem and it's mounted read-only, and we're not doing
220
220
         * a read/write check, then everything's fine.
221
221
         */
222
 
        if ((!(ctx->mount_flags & EXT2_MF_MOUNTED)) ||
 
222
        if ((!(ctx->mount_flags & (EXT2_MF_MOUNTED | EXT2_MF_BUSY))) ||
223
223
            ((ctx->mount_flags & EXT2_MF_ISROOT) &&
224
224
             (ctx->mount_flags & EXT2_MF_READONLY) &&
225
225
             !(ctx->options & E2F_OPT_WRITECHECK)))
227
227
 
228
228
        if ((ctx->options & E2F_OPT_READONLY) &&
229
229
            !(ctx->options & E2F_OPT_WRITECHECK)) {
230
 
                log_out(ctx, _("Warning!  %s is mounted.\n"),
231
 
                        ctx->filesystem_name);
 
230
                log_out(ctx, _("Warning!  %s is %s.\n"),
 
231
                        ctx->filesystem_name,
 
232
                        ctx->mount_flags & EXT2_MF_MOUNTED ?
 
233
                                "mounted" : "in use");
232
234
                return;
233
235
        }
234
236
 
235
 
        log_out(ctx, _("%s is mounted.  "), ctx->filesystem_name);
236
 
        if (!ctx->interactive)
 
237
        log_out(ctx, _("%s is %s.\n"), ctx->filesystem_name,
 
238
                ctx->mount_flags & EXT2_MF_MOUNTED ? "mounted" : "in use");
 
239
        if (!ctx->interactive || ctx->mount_flags & EXT2_MF_BUSY)
237
240
                fatal_error(ctx, _("Cannot continue, aborting.\n\n"));
238
241
        puts("\007\007\007\007");
239
242
        log_out(ctx, _("\n\nWARNING!!!  "
1137
1140
        int old_bitmaps;
1138
1141
        __u32 features[3];
1139
1142
        char *cp;
 
1143
        int qtype;  /* quota type */
1140
1144
 
1141
1145
        clear_problem_context(&pctx);
1142
1146
        sigcatcher_setup();
1217
1221
                            &old_bitmaps);
1218
1222
        if (!old_bitmaps)
1219
1223
                flags |= EXT2_FLAG_64BITS;
1220
 
        if ((ctx->options & E2F_OPT_READONLY) == 0)
 
1224
        if ((ctx->options & E2F_OPT_READONLY) == 0) {
1221
1225
                flags |= EXT2_FLAG_RW;
1222
 
        if ((ctx->mount_flags & EXT2_MF_MOUNTED) == 0)
1223
 
                flags |= EXT2_FLAG_EXCLUSIVE;
 
1226
                if (!(ctx->mount_flags & EXT2_MF_ISROOT &&
 
1227
                      ctx->mount_flags & EXT2_MF_READONLY))
 
1228
                        flags |= EXT2_FLAG_EXCLUSIVE;
 
1229
        }
1224
1230
 
1225
1231
        retval = try_open_fs(ctx, flags, io_ptr, &fs);
1226
1232
 
1575
1581
                journal_size = -1;
1576
1582
 
1577
1583
        if (sb->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_QUOTA) {
1578
 
                int qtype;
1579
1584
                /* Quotas were enabled. Do quota accounting during fsck. */
1580
1585
                if ((sb->s_usr_quota_inum && sb->s_grp_quota_inum) ||
1581
1586
                    (!sb->s_usr_quota_inum && !sb->s_grp_quota_inum))
1619
1624
no_journal:
1620
1625
 
1621
1626
        if (ctx->qctx) {
1622
 
                quota_write_inode(ctx->qctx, -1);
 
1627
                int i, needs_writeout;
 
1628
                for (i = 0; i < MAXQUOTAS; i++) {
 
1629
                        if (qtype != -1 && qtype != i)
 
1630
                                continue;
 
1631
                        needs_writeout = 0;
 
1632
                        pctx.num = i;
 
1633
                        retval = quota_compare_and_update(ctx->qctx, i,
 
1634
                                                          &needs_writeout);
 
1635
                        if ((retval || needs_writeout) &&
 
1636
                            fix_problem(ctx, PR_6_UPDATE_QUOTAS, &pctx))
 
1637
                                quota_write_inode(ctx->qctx, i);
 
1638
                }
1623
1639
                quota_release_context(&ctx->qctx);
1624
1640
        }
1625
1641