Hi, Minfei
It is a good behaviour to resend it after long time if you want other people to
review your patches.
Before asking for review, you can just resend it.
----- Original Message -----
From: "Minfei Huang" <mhuang(a)redhat.com>
To: "Dave Young" <dyoung(a)redhat.com>
Cc: kexec(a)lists.fedoraproject.org
Sent: Wednesday, April 15, 2015 1:35:46 PM
Subject: Re: [PATCH] mkdumprd: Fix the bug to get persistent device correctly
On 04/15/15 at 11:15am, Dave Young wrote:
On 04/14/15 at 05:45pm, Minfei Huang wrote:
> Do someone who can help review my patch?
Please resend the patch, I do not keep old mails for long time..
There is no other comment to this patch, except for yours.
>
> Thanks
> Minfei
>
> On 03/09/15 at 07:34pm, Minfei Huang wrote:
> > One filesystem has an unique uuid to detect itself. For btrfs, several
> > diskes can have the same uuid, and the soft link /dev/disk/by-uuid/$uuid
> > points the only one disk which is contained in the btrfs.
> >
> > It may fails to filter out the disk by uuid, although there is a
> > filesystem on the disk, like btrfs.
> >
> > In order to get the persistent device, we can use command "blkid".
Several questions:
What is the persistant device name for device formated as btrfs?
Persistent device name is an uuid which can determine the uniqe device.
How does udev create /dev/by-uuid/* links for each sub volume?
One filesystem has only one uuid, which points to a disk by soft link.
What's the difference between blkid and other files in
/dev/by-uuid/*
For btrfs, one filesystem may contain several disk under it. So it may
fail to find the device from the /dev/disk/by-uuid/*, because
/dev/disk/by-uuid/* only points to one of the disk.
So we can _not_ use device name to fine the persistent device
name(uuid).
But it works well, once we use blkid to find the persistent device.
Thanks
Minfei
> >
> > Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> > ---
> > mkdumprd | 16 ++++++++++++++--
> > 1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/mkdumprd b/mkdumprd
> > index 4d251ba..5fb578b 100644
> > --- a/mkdumprd
> > +++ b/mkdumprd
> > @@ -27,14 +27,14 @@ perror() {
> > }
> >
> > get_persistent_dev() {
> > - local i _tmp _dev
> > + local i _tmp _dev _uuid
> >
> > _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
> > + for i in /dev/mapper/* /dev/disk/by-id/*; do
> > _tmp=$(udevadm info --query=name --name="$i"
2>/dev/null)
> > if [ "$_tmp" = "$_dev" ]; then
> > echo $i
> > @@ -42,6 +42,18 @@ get_persistent_dev() {
> > fi
> > done
> >
> > + if [ "x" != "x""$(blkid $1 | grep
"UUID")" ]; then
> > + _uuid=`blkid $1 | grep "UUID" | awk '{print $2}'`
> > + _uuid=${_uuid#*\"}
> > + _uuid=${_uuid%\"*}
> > + _dev=/dev/disk/by-uuid/$_uuid
> > + _tmp=$(udevadm info --query=name --name=$_dev 2>/dev/null)
> > + if [ "x" != "x"$_tmp ]; then
> > + echo $_dev
> > + return
> > + fi
> > + fi
> > +
> > perror "WARNING: Persistent device name of $1 not found. Using $1 as
dump target name"
> > echo $1
> > }
> > --
> > 1.9.3
> >
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec
>
>