From 3a68a67990b1d05af8156617def136e6c0f5bb7a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 8 Nov 2002 14:10:15 -0500 Subject: [PATCH] fs_ext2.c (fs_expand, fs_shrink), fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck, mke2fs or resize2fs dies with a signal, or if the exit with a non-zero exit status. --- lib/evms/ChangeLog | 5 +++++ lib/evms/fs_ext2.c | 16 ++++++++++++++-- lib/evms/fsimext2.c | 10 +++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/lib/evms/ChangeLog b/lib/evms/ChangeLog index a74a8d5..96dbd32 100644 --- a/lib/evms/ChangeLog +++ b/lib/evms/ChangeLog @@ -1,5 +1,10 @@ 2002-11-08 Theodore Ts'o + * fs_ext2.c (fs_expand, fs_shrink), + fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck, + mke2fs or resize2fs dies with a signal, or if the exit + with a non-zero exit status. + * fsimext2.c (set_mkfs_options): If the hard sector size is 1024, don't force a blocksize of 1024; there's no need to do so. diff --git a/lib/evms/fs_ext2.c b/lib/evms/fs_ext2.c index c327600..17c1c88 100644 --- a/lib/evms/fs_ext2.c +++ b/lib/evms/fs_ext2.c @@ -372,9 +372,15 @@ static int fs_expand( logical_volume_t * volume, } if ( WIFEXITED(status) ) { /* get expand exit code */ - LOG("Expand completed with rc = %d \n",status); rc = WEXITSTATUS(status); + if (rc) + LOG("Expand completed successfully\n"); + else + LOG("Expand completed with rc = %d\n", status); } else { + if (WIFSIGNALED(status)) + LOG("Expand died with signal %d", + WTERMSIG(status)); rc = EINTR; } } @@ -529,9 +535,15 @@ static int fs_shrink( logical_volume_t * volume, } if ( WIFEXITED(status) ) { /* get shrink exit code */ - LOG("Shrink completed with rc = %d \n",status); rc = WEXITSTATUS(status); + if (rc) + LOG("Shrink completed successfully\n"); + else + LOG("Shrink completed with rc = %d\n",status); } else { + if (WIFSIGNALED(status)) + LOG("Shrink died with signal %d", + WTERMSIG(status)); rc = EINTR; } } diff --git a/lib/evms/fsimext2.c b/lib/evms/fsimext2.c index a3660ff..344364b 100644 --- a/lib/evms/fsimext2.c +++ b/lib/evms/fsimext2.c @@ -139,7 +139,12 @@ int fsim_mkfs(logical_volume_t * volume, option_array_t * options ) if ( WIFEXITED(status) ) { /* get mke2fs exit code */ rc = WEXITSTATUS(status); + if (rc) + LOG("mke2fs exited with status %d", rc); } else { + if (WIFSIGNALED(status)) + LOG("mke2fs died with signal %d", + WTERMSIG(status)); rc = EINTR; } } @@ -358,10 +363,13 @@ int fsim_fsck(logical_volume_t * volume, option_array_t * options, if ( WIFEXITED(status) ) { /* get e2fsck exit code */ *ret_status = WEXITSTATUS(status); - LOG("e2fsck completed with exit code %d \n", + LOG("e2fsck completed with exit code %d\n", *ret_status); rc = 0; } else { + if (WIFSIGNALED(status)) + LOG("e2fsck died with signal %d", + WTERMSIG(status)); rc = EINTR; } } -- 1.8.3.1