On 03/12/14 at 10:46am, Vivek Goyal wrote:
On Wed, Mar 12, 2014 at 10:36:03PM +0800, Baoquan He wrote:
[..]
> > > _target=$(get_root_fs_device)
> > > if [ -b "$_target" ]; then
> >
> > Why do we need to make sure that rootfs deivce is a block device?
>
> If NFS cared, it should look like:
>
> if [ -n "$_target" ]; then
>
> will change.
I think we don't have to query for rootfs device at all? I can't see
why do we have to.
You are right, I dropped into the inertial thinking.
>
> >
> > > mkdir -p $SAVE_PATH
> > > - _mntpoint=`df $SAVE_PATH | tail -1 | awk '{print $NF}'`
> > > + _ret=$?
> > > + if [ $_ret -ne 0 ]; then
> > > + perror_exit "mkdir failed on $SAVE_PATH"
> > > + fi
> >
> > I think we should resuse mkdir_save_path_fs() here. So first we need
> > to set dump disk and path relative to disk and then call
> > mkdir_save_path_fs(). This will also take care of handling read only
> > mounted disks.
>
> I can't. Because "df" need be executed on existing path. E.g if
/dev/vdb
> is mounted on /mnt, and the "path" is /mnt/nfs. Then "mkdir -p
/mnt/nfs"
> need be executed firstly, otherwise "df /mnt/nfs" will fail if /mnt/nfs
> does not exist.
Ok, this is another bad assumption we have in code that kdump needs to
create the "path". I think we need to get rid of it. We should expect
directory as specified by "path" to be present and if it is not present,
we should error out saying "$path" does not exist. Can you please cleanup
the code and put this in a separate patch.
This is an idea, I am gonna try.
Baoquan
Thanks
Thanks
Vivek