On Thu, Oct 06, 2016 at 08:57:44AM +0200, Otto Moerbeek wrote:
> On Tue, Oct 04, 2016 at 01:26:06PM +0200, Otto Moerbeek wrote:
> 
> > On Tue, Oct 04, 2016 at 04:00:50AM -0700, Claus Assmann wrote:
> > 
> > > On Tue, Oct 04, 2016, Dmitrij D. Czarkoff wrote:
> > > 
> > > [please do not Cc me]
> > > 
> > > > I shouldn't have started on sending patches at 3AM.  This one should do
> > > > what I intended it to do.  Sorry for noise.
> > > 
> > > > +               else if (t == NULL && sa->minsz != sa->maxsz)
> > > > +                       errx(1, "%s: parse error on line %u", filename, 
> > > > idx);
> > > 
> > > This doesn't seem to resolve the problem that sa->rate is
> > > not initialized, so a simple file like this still triggers
> > > the error message (at least in my tests):
> > > 
> > > / 500M
> > > swap      1G
> > > /usr      2G
> > > /home     500G
> > 
> > Likely, this is better.
> 
> Any OK?
> 

Yes, ok, this fixes one bug.

However, if I apply the above template to a ~300G disk, the
autoallocation fails silently. Is that intended?

# cat /tmp/templ
/       500M
swap    1G
/usr    2G
/home   500G
# obj/disklabel -A -n -T /tmp/templ -E sd0
Label editor (enter '?' for help at any prompt)
> p
OpenBSD area: 64-625137345; size: 625137281; free: 625137281
#                size           offset  fstype [fsize bsize   cpg]
  c:        625142448                0  unused
>

> > 
> >     -Otto
> > 
> > Index: editor.c
> > ===================================================================
> > RCS file: /cvs/src/sbin/disklabel/editor.c,v
> > retrieving revision 1.303
> > diff -u -p -r1.303 editor.c
> > --- editor.c        2 Sep 2016 10:47:17 -0000       1.303
> > +++ editor.c        4 Oct 2016 11:25:36 -0000
> > @@ -2386,6 +2386,7 @@ parse_autotable(char *filename)
> >                 idx + 1, sizeof(*sa))) == NULL)
> >                     err(1, NULL);
> >             sa = &(alloc_table[0].table[idx]);
> > +           memset(sa, 0, sizeof(*sa));
> >             idx++;
> >  
> >             if ((sa->mp = get_token(&buf, &len)) == NULL ||
> 

Reply via email to