[dm-devel] [PATCH] kpartx: recognize DASD on loop devices again

Christophe Varoqui christophe.varoqui at opensvc.com
Mon Jul 8 15:00:59 UTC 2019


Thanks for the review.

Martin, can you post a rebased version of this patch ?

Thanks,
Christophe

On Mon, Jul 8, 2019 at 4:27 PM Benjamin Marzinski <bmarzins at redhat.com>
wrote:

> On Fri, Jun 28, 2019 at 07:29:41PM +0000, Martin Wilck wrote:
> > From: Martin Wilck <mwilck at suse.com>
> >
> > Since 4d57b868, DASD partition tables are only recognized on
> > DASD hardware. This turns out to break certain software that works
> > e.g. with DASD partition tables on loop devices. The problem that
> > 4d57b868 attempted to fix was that "unlabeled disk" format has
> > no signature at all and is detected on any volume, including
> > empty ones.
> >
> > With this patch, DASD partition table formats other than "unlabeled
> > disk" are detected on non-DASD devices again.
> >
> > Fixes: 4d57b868 "kpartx: only recognize dasd part table on DASD"
>
> Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>
>
> > ---
> >  kpartx/dasd.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/kpartx/dasd.c b/kpartx/dasd.c
> > index 61b609a5..3fcef6ad 100644
> > --- a/kpartx/dasd.c
> > +++ b/kpartx/dasd.c
> > @@ -133,9 +133,6 @@ read_dasd_pt(int fd, struct slice all, struct slice
> *sp, int ns)
> >                       /* Couldn't open the device */
> >                       return -1;
> >               }
> > -     } else if ((unsigned int)major(sbuf.st_rdev) != 94) {
> > -                     /* Not a DASD */
> > -                     return -1;
> >       } else {
> >               fd_dasd = dup(fd);
> >       }
> > @@ -277,6 +274,10 @@ read_dasd_pt(int fd, struct slice all, struct slice
> *sp, int ns)
> >                       size = disksize;
> >                       if (fmt_size < size)
> >                               size = fmt_size;
> > +             } else if ((unsigned int)major(sbuf.st_rdev) != 94) {
> > +                     /* Not a DASD */
> > +                     retval = -1;
> > +                     goto out;
> >               } else
> >                       size = disksize;
> >
> > --
> > 2.21.0
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20190708/d932f80c/attachment.htm>


More information about the dm-devel mailing list