On Mon, Mar 17, 2014 at 03:49:18PM +0800, Baoquan He wrote:
[..]
+#handle the case user does not specify the dump target explicitly
+handle_default_dump_target()
{
local _target
local _mntpoint
+ local _fstype
- _target=$(get_user_configured_dump_disk)
- [ -n "$_target" ] && return
+ is_user_configured_dump_target && return
- _target=$(get_root_fs_device)
- if [ -b "$_target" ]; then
- mkdir -p $SAVE_PATH
- _mntpoint=`df $SAVE_PATH | tail -1 | awk '{print $NF}'`
- if [ "$_mntpoint" != "/" ]; then
- perror "No dump target specified. Default dump target is rootfs block
device."
- perror "But dump path $SAVE_PATH is not backed by rootfs block device.
"
- perror_exit "Either explicitly specify a dump target or specify a dump
path backed by rootfs block device"
+ if [ ! -d $SAVE_PATH ]; then
+ perror_exit "Please check if path:$SAVE_PATH has been created."
+ fi
Why are you not using check_save_path_fs() you intorduced in previous
patch.
Rest of the patch looks good to me.
Thanks
Vivek