]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: warn if running in low memory mode
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Jan 2011 06:24:00 +0000 (17:24 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Jan 2011 06:24:00 +0000 (17:24 +1100)
When checking large filesystems, xfs_repair makes an estimate of how
much RAM it will need to execute effectively. If the amount of RAM
is less than this, it reduces the bhash size and turns of
prefetching, which will substantially slow down the repair process.
Add a warning that indicates this is happening, along with a
recommendation of how much RAM repair calculates it needs to run
with prefetching enabled.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/xfs_repair.c

index e36eeae9adfc78a46965235e499710c4e6ea088f..1d9ad460eb639e056010f0360a69c75e15190143 100644 (file)
@@ -650,12 +650,18 @@ main(int argc, char **argv)
                         * Turn off prefetch and minimise libxfs cache if
                         * physical memory is deemed insufficient
                         */
-                       if (max_mem_specified)
-                               do_abort(_("Required memory for repair is "
-                                       "greater that the maximum specified "
-                                       "with the -m option. Please increase "
-                                       "it to at least %lu.\n"),
+                       if (max_mem_specified) {
+                               do_abort(
+       _("Required memory for repair is greater that the maximum specified\n"
+         "with the -m option. Please increase it to at least %lu.\n"),
                                        mem_used / 1024);
+                       } else {
+                               do_warn(
+       _("Not enough RAM available for repair to enable prefetching.\n"
+         "This will be _slow_.\n"
+         "You need at least %luMB RAM to run with prefetching enabled.\n"),
+                                       mem_used * 1280 / (1024 * 1024));
+                       }
                        do_prefetch = 0;
                        libxfs_bhash_size = 64;
                } else {