dump_localfs error path fix
in dump_localfs, we should error out if fstab mount fails Also error out if mkdir fails. vivek: display error message for debugging purpose. Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
423e0019c4
commit
3d470c4be2
@ -85,11 +85,16 @@ dump_localfs()
|
||||
{
|
||||
local _dev=`to_dev_name $1`
|
||||
local _mp=`get_mp $_dev`
|
||||
|
||||
if [ -z "$_mp" ]; then
|
||||
echo "kdump: error: Dump target $1 is not mounted."
|
||||
return 1
|
||||
fi
|
||||
if [ "$_mp" = "$NEWROOT/" ] || [ "$_mp" = "$NEWROOT" ]
|
||||
then
|
||||
mount -o remount,rw $_mp || return 1
|
||||
fi
|
||||
mkdir -p $_mp/$KDUMP_PATH/$DATEDIR
|
||||
mkdir -p $_mp/$KDUMP_PATH/$DATEDIR || return 1
|
||||
$CORE_COLLECTOR /proc/vmcore $_mp/$KDUMP_PATH/$DATEDIR/vmcore || return 1
|
||||
umount $_mp || return 1
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user