On 06/05/2016:02:52:19 PM, Xunlei Pang wrote:
On 2016/05/06 at 11:02, Baoquan He wrote:
> On 05/05/16 at 05:20pm, Pratyush Anand wrote:
>> raw devices are not mounted and also does not need to contain any
>> filesystem. So they may have UUIDs(when formatted) and may not have UUIDs
>> when raw. Therefore, do not look for persistent names by-uuid for raw
>> devices.
>>
>> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
>> Suggested-by: Dave Young <dyoung(a)redhat.com>
This has already been suggested by Dave so should be OK.
~Pratyush
> >> ---
> >> mkdumprd | 14 ++++++++++----
> >> 1 file changed, 10 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/mkdumprd b/mkdumprd
> >> index 6e3d9757f3d8..ad40d2872f98 100644
> >> --- a/mkdumprd
> >> +++ b/mkdumprd
> >> @@ -30,14 +30,20 @@ perror() {
> >> }
> >>
> > I don't object this patch strongly. But seems it makes
> > get_persistent_dev from dracut implementation further and further. I am
> > not blaming this patch, just it's always Vivek's wish that we remove
> > this from kdump and reuse the counterpart in dracut. Well, leave the
> > decision to Dave and Xunlei.
>
> I've no idea about the thing you mentioned, leave it to Dave :-)
>
> Regards,
> Xunlei
>
> >
> >> get_persistent_dev() {
> >> - local i _tmp _dev
> >> + local i _tmp _dev _lookup_dirs
> >>
> >> _dev=$(udevadm info --query=name --name="$1" 2>/dev/null)
> >> [ -z "$_dev" ] && {
> >> perror_exit "Kernel dev name of $1 is not found."
> >> }
> >>
> >> - for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
> >> + if [[ $2 = "raw" ]];then
> >> + _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*"
> >> + else
> >> + _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/*
/dev/disk/by-id/*"
> >> + fi
> >> +
> >> + for i in $_lookup_dirs; do
> >> _tmp=$(udevadm info --query=name --name="$i"
2>/dev/null)
> >> if [ "$_tmp" = "$_dev" ]; then
> >> echo $i
> >> @@ -138,7 +144,7 @@ to_mount() {
> >> _mntopts="$_target $_fstype $_options"
> >> #for non-nfs _dev converting to use udev persistent name
> >> if [ -b "$_source" ]; then
> >> - _pdev="$(get_persistent_dev $_source)"
> >> + _pdev="$(get_persistent_dev $_source $_fstype)"
> >> if [ $? -ne 0 ]; then
> >> return 1
> >> fi
> >> @@ -565,7 +571,7 @@ do
> >> dd if=$config_val count=1 of=/dev/null > /dev/null 2>&1
|| {
> >> perror_exit "Bad raw disk $config_val"
> >> }
> >> - _praw=$(get_persistent_dev $config_val)
> >> + _praw=$(get_persistent_dev $config_val "raw")
> >> if [ $? -ne 0 ]; then
> >> exit 1
> >> fi
> >> --
> >> 2.5.5
> >>