From 12b1f31cbbaf55544efae206ee997ea1fd2692f6 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sat, 6 Jun 2009 22:00:20 +0000 Subject: [PATCH] Round readahead more inteligently and print warning. Round readahead at least to one page up. Print warning instead of verbose message. --- WHATS_NEW | 1 + tools/lvchange.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index b4243663c..e74549696 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.48 - =============================== + Round up requested readahead to at least one page and print warning. Try to repair vg before actual vgremove when force flag provided. Fix possible double release of VG after recovery. Add parameter to process_each_vg specifying what to do with inconsistent VG. diff --git a/tools/lvchange.c b/tools/lvchange.c index 10795e3bb..5abb6e543 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -370,9 +370,12 @@ static int lvchange_readahead(struct cmd_context *cmd, if (read_ahead != DM_READ_AHEAD_AUTO && read_ahead != DM_READ_AHEAD_NONE && read_ahead % pagesize) { - read_ahead = (read_ahead / pagesize) * pagesize; - log_verbose("Rounding down readahead to %u sectors, a multiple " - "of page size %u.", read_ahead, pagesize); + if (read_ahead < pagesize) + read_ahead = pagesize; + else + read_ahead = (read_ahead / pagesize) * pagesize; + log_warn("WARNING: Overriding readahead to %u sectors, a multiple " + "of %uK page size.", read_ahead, pagesize >> 1); } if (lv->read_ahead == read_ahead) {