Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions kdumpctl
Original file line number Diff line number Diff line change
Expand Up @@ -2065,17 +2065,21 @@ set_vmcore_creation_status()
fetch_status()
{
local _test_id="$1" _mnt
local _status
local _status _timeout_cmd=""

is_raw_dump_target && return 2

_status="${OPT[path]}/kdump-test-$_test_id/vmcore-creation.status"

if is_nfs_dump_target || is_local_target; then
_mnt=$(get_mntpoint_from_target "${OPT[_target]}")
if is_nfs_dump_target; then
_timeout_cmd="timeout --preserve-status 5m"
fi

if [[ -z $_mnt ]] || ! is_mounted "$_mnt"; then
mkdir -p "$TMPMNT"
mount "${OPT[_target]}" "$TMPMNT" -t "${OPT[_fstype]}" -o defaults ||
$_timeout_cmd mount "${OPT[_target]}" "$TMPMNT" -t "${OPT[_fstype]}" -o defaults ||
{
dwarn "Failed to mount ${OPT[_target]}" && return 2
}
Expand Down
12 changes: 8 additions & 4 deletions mkdumprd
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ mount_failure()
msg="$msg for kdump preflight check."

if [[ $_fstype == "nfs" ]]; then
msg="$msg Please make sure nfs-utils has been installed."
msg="$msg Please make sure nfs-utils has been installed, and nfs server is accessible."
fi

perror_exit "$msg"
Expand All @@ -217,7 +217,7 @@ mount_failure()
check_user_configured_target()
{
local _target=$1 _cfg_fs_type=$2 _mounted
local _mnt _opt _fstype
local _mnt _opt _fstype _timeout_cmd=""

_mnt=$(get_mntpoint_from_target "$_target")
_opt=$(get_mntopt_from_target "$_target")
Expand All @@ -235,12 +235,16 @@ check_user_configured_target()
_fstype="$_cfg_fs_type"
fi

if [[ $_fstype == "nfs"* ]]; then
_timeout_cmd="timeout --preserve-status 10m"
fi

# For noauto mount, mount it inplace with default value.
# Else use the temporary target directory
if [[ -n $_mnt ]]; then
if ! is_mounted "$_mnt"; then
if [[ $_opt == *",noauto"* ]]; then
mount "$_mnt" || mount_failure "$_target" "$_mnt" "$_fstype"
$_timeout_cmd mount "$_mnt" || mount_failure "$_target" "$_mnt" "$_fstype"
_mounted=$_mnt
else
perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
Expand All @@ -249,7 +253,7 @@ check_user_configured_target()
else
_mnt=$MKDUMPRD_TMPMNT
mkdir -p "$_mnt"
mount "$_target" "$_mnt" -t "$_fstype" -o defaults || mount_failure "$_target" "" "$_fstype"
$_timeout_cmd mount "$_target" "$_mnt" -t "$_fstype" -o defaults || mount_failure "$_target" "" "$_fstype"
_mounted=$_mnt
fi

Expand Down
Loading