summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-01-14 00:03:43 +0800
committerRichard W.M. Jones <rjones@redhat.com>2012-01-13 16:48:20 +0000
commit0eaf06e673833bc25673d5c3d2487fffae310285 (patch)
tree424362f584fa06019d4a08c1fcdc690a396779aa
parentf6db1ec41050e70580674ebbeb8fac5335df3284 (diff)
downloadlibguestfs-0eaf06e673833bc25673d5c3d2487fffae310285.tar.gz
libguestfs-0eaf06e673833bc25673d5c3d2487fffae310285.tar.xz
libguestfs-0eaf06e673833bc25673d5c3d2487fffae310285.zip
ext2: tweak the error returned message of resize2fs-M(BZ755729)
Tweak the error message "e2fsck -f" and "e2fsck -fy". Indicate the user to use the correct and/or forceall options. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
-rw-r--r--daemon/ext2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c
index 79fd3549..c280ca2e 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -277,9 +277,14 @@ do_resize2fs_M (const char *device)
if (e2prog (prog) == -1)
return -1;
- r = command (NULL, &err, prog, "-M" , device, NULL);
+ r = command (NULL, &err, prog, "-M", device, NULL);
if (r == -1) {
- reply_with_error ("%s", err);
+ if (strstr (err, "e2fsck -f")) {
+ free (err);
+ reply_with_error ("you need to run e2fsck with the correct and/or forceall options first");
+ } else {
+ reply_with_error ("%s", err);
+ }
free (err);
return -1;
}