I also have this problem.

I don't think that fiddling with the init script is the right fix: it
does too much parsing of mount options already.  Instead, I think the
correct thing to do is get quotacheck(8) to skip filesystems using
journalled quotas.  To this end, I offer the following (largely
untested!) patch.


diff --git a/debian/changelog b/debian/changelog
index fe31eba..b5132a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+quota (4.00-4+deb7u2distorted1) unstable; urgency=low
+
+  * Add and use -J option to skip filesystems using quota journalling, for
+    #743163.
+
+ -- Mark Wooding <m...@distorted.org.uk>  Fri, 09 May 2014 17:58:18 +0100
+
 quota (4.00-4+deb7u1) testing-proposed-updates; urgency=low
 
   * Non-maintainer upload.
diff --git a/debian/quota.init b/debian/quota.init
index ccf60f9..53f1630 100644
--- a/debian/quota.init
+++ b/debian/quota.init
@@ -20,7 +20,7 @@ quotaisoff=/var/lib/quota/off
 quotaisnew=/var/lib/quota/new
 
 ALLFLAGS=-aug
-CHECKFLAGS=${ALLFLAGS}m
+CHECKFLAGS=${ALLFLAGS}mJ
 USERFLAGS=-uc
 GROUPFLAGS=-gc
 
diff --git a/quotacheck.8 b/quotacheck.8
index fe020f4..dbc83a0 100644
--- a/quotacheck.8
+++ b/quotacheck.8
@@ -146,6 +146,11 @@ Quota format with 64-bit quota limits and usage,
 .B -a, --all
 Check all mounted non-NFS filesystems in
 .B /etc/mtab
+.B -J, --not-journal
+With
+.BR -a ,
+don't check filesystems using quota journalling.
+This flag is intended to be used at boot time.
 .TP
 .B -R, --exclude-root
 When used together with the
diff --git a/quotacheck.c b/quotacheck.c
index d8515af..675370e 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -313,6 +313,7 @@ static void usage(void)
 -R, --exclude-root        exclude root when checking all filesystems\n\
 -F, --format=formatname   check quota files of specific format\n\
 -a, --all                 check all filesystems\n\
+-J, --not-journalled     with -a, don't check journalled filesystems\n\
 -h, --help                display this message and exit\n\
 -V, --version             display version information and exit\n\n"), 
progname);
        printf(_("Bugs to %s\n"), MY_EMAIL);
@@ -336,13 +337,14 @@ static void parse_options(int argcnt, char **argstr)
                { "force", 0, NULL, 'f' },
                { "format", 1, NULL, 'F' },
                { "no-remount", 0, NULL, 'm' },
+               { "not-journalled", 0, NULL, 'J' },
                { "try-remount", 0, NULL, 'M' },
                { "exclude-root", 0, NULL, 'R' },
                { "all", 0, NULL, 'a' },
                { NULL, 0, NULL, 0 }
        };
 
-       while ((ret = getopt_long(argcnt, argstr, "VhbcvugidnfF:mMRa", 
long_opts, NULL)) != -1) {
+       while ((ret = getopt_long(argcnt, argstr, "VhbcvugidnfF:mJMRa", 
long_opts, NULL)) != -1) {
                switch (ret) {
                  case 'b':
                          flags |= FL_BACKUPS;
@@ -387,6 +389,9 @@ static void parse_options(int argcnt, char **argstr)
                  case 'a':
                          flags |= FL_ALL;
                          break;
+                 case 'J':
+                         flags |= FL_NOTJOURNAL;
+                         break;
                  case 'R':
                          flags |= FL_NOROOT;
                          break;
@@ -997,7 +1002,7 @@ out:
 }
 
 /* Detect quota format from filename of present files */
-static int detect_filename_format(struct mntent *mnt, int type)
+static int detect_filename_format(struct mntent *mnt, int type, int *journal_r)
 {
        char *option;
        struct stat statbuf;
@@ -1006,8 +1011,11 @@ static int detect_filename_format(struct mntent *mnt, 
int type)
        int fmt;
 
        if (strcmp(mnt->mnt_type, MNTTYPE_XFS) == 0 ||
-           strcmp(mnt->mnt_type, MNTTYPE_GFS2) == 0)
+           strcmp(mnt->mnt_type, MNTTYPE_GFS2) == 0) {
+               if (journal_r)
+                       *journal_r = 0;
                return QF_XFS;
+       }
 
        if (type == USRQUOTA) {
                if ((option = hasmntopt(mnt, MNTOPT_USRQUOTA)))
@@ -1027,6 +1035,8 @@ static int detect_filename_format(struct mntent *mnt, int 
type)
                        option += strlen(MNTOPT_GRPJQUOTA);
                }
        }
+       if (journal_r)
+               *journal_r = journal;
        if (!option)
                die(2, _("Cannot find quota option on filesystem %s with 
quotas!\n"), mnt->mnt_dir);
        if (journal) {
@@ -1099,6 +1109,7 @@ static int check_all(void)
        int checked = 0;
        static int warned;
        int failed = 0;
+       int journal;
 
        if (init_mounts_scan((flags & FL_ALL) ? 0 : 1, &mntpoint, 0) < 0)
                die(2, _("Cannot initialize mountpoint scan.\n"));
@@ -1110,6 +1121,7 @@ static int check_all(void)
                        continue;
                }
                cfmt = fmt;
+               journal = 0;
                if (uwant && hasquota(mnt, USRQUOTA, 0))
                        ucheck = 1;
                else
@@ -1121,16 +1133,22 @@ static int check_all(void)
                if (!ucheck && !gcheck)
                        continue;
                if (cfmt == -1) {
-                       cfmt = detect_filename_format(mnt, ucheck ? USRQUOTA : 
GRPQUOTA);
+                       cfmt = detect_filename_format(mnt, ucheck ? USRQUOTA : 
GRPQUOTA, &journal);
                        if (cfmt == -1) {
                                errstr(_("Cannot guess format from filename on 
%s. Please specify format on commandline.\n"),
                                        mnt->mnt_fsname);
                                failed = -1;
                                continue;
                        }
-                       debug(FL_DEBUG, _("Detected quota format %s\n"), 
fmt2name(cfmt));
+                       debug(FL_DEBUG, _("Detected quota format %s, %s\n"),
+                             fmt2name(cfmt), journal ? _("with journal") : 
_("without journal"));
                }
 
+               checked++;
+
+               if ((flags & FL_NOTJOURNAL) && journal)
+                       continue;
+
                if (flags & FL_VERBOSE && !hasmntopt(mnt, MNTOPT_USRJQUOTA) &&
                    !hasmntopt(mnt, MNTOPT_GRPJQUOTA) && !warned &&
                    (!strcmp(mnt->mnt_type, MNTTYPE_EXT3) ||
@@ -1162,7 +1180,6 @@ static int check_all(void)
                        }
                }
 
-               checked++;
                failed |= check_dir(mnt);
        }
        end_mounts_scan();
diff --git a/quotacheck.h b/quotacheck.h
index 0abdaaa..502c0e7 100644
--- a/quotacheck.h
+++ b/quotacheck.h
@@ -26,6 +26,7 @@
 #define FL_NOROOT 512          /* Scan all mountpoints except root */
 #define FL_BACKUPS 1024                /* Create backup of old quota file? */
 #define FL_VERYVERBOSE 2048    /* Print directory names when checking */
+#define FL_NOTJOURNAL 4096     /* Don't check journalled quotas */
 
 extern int flags;              /* Options from command line */
 extern struct util_dqinfo old_info[MAXQUOTAS]; /* Loaded info from file */


-- [mdw]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to