Re: parsing in the ceph osd subsystem

2012-11-29 Thread Sage Weil
On Thu, 29 Nov 2012, Andrey Korolyov wrote:
 $ ceph osd down -
 osd.0 is already down
 $ ceph osd down ---
 osd.0 is already down
 
 the same for ``+'', ``/'', ``%'' and so - I think that for osd subsys
 ceph cli should explicitly work only with positive integers plus zero,
 refusing all other input.

which branch is this?  this parsing is cleaned u pin the latest 
next/master.



 --
 To unsubscribe from this list: send the line unsubscribe ceph-devel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
 
--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: parsing in the ceph osd subsystem

2012-11-29 Thread Andrey Korolyov
On Thu, Nov 29, 2012 at 8:34 PM, Sage Weil s...@inktank.com wrote:
 On Thu, 29 Nov 2012, Andrey Korolyov wrote:
 $ ceph osd down -
 osd.0 is already down
 $ ceph osd down ---
 osd.0 is already down

 the same for ``+'', ``/'', ``%'' and so - I think that for osd subsys
 ceph cli should explicitly work only with positive integers plus zero,
 refusing all other input.

 which branch is this?  this parsing is cleaned u pin the latest
 next/master.



It was produced by 0.54-tag. I have built
dd3a24a647d0b0f1153cf1b102ed1f51d51be2f2 today and problem has
gone(except parsing ``-0'' as 0 and 0/001 as 0 and 1
correspondingly).


 --
 To unsubscribe from this list: send the line unsubscribe ceph-devel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: parsing in the ceph osd subsystem

2012-11-29 Thread Joao Eduardo Luis
On 11/29/2012 07:01 PM, Andrey Korolyov wrote:
 On Thu, Nov 29, 2012 at 8:34 PM, Sage Weil s...@inktank.com wrote:
 On Thu, 29 Nov 2012, Andrey Korolyov wrote:
 $ ceph osd down -
 osd.0 is already down
 $ ceph osd down ---
 osd.0 is already down

 the same for ``+'', ``/'', ``%'' and so - I think that for osd subsys
 ceph cli should explicitly work only with positive integers plus zero,
 refusing all other input.

 which branch is this?  this parsing is cleaned u pin the latest
 next/master.


 
 It was produced by 0.54-tag. I have built
 dd3a24a647d0b0f1153cf1b102ed1f51d51be2f2 today and problem has
 gone(except parsing ``-0'' as 0 and 0/001 as 0 and 1
 correspondingly).

We use strtol() to parse numeric values, and '-0', '0' or '1'
are valid numeric values. I suppose we could enforce the argument to be
numeric only, hence getting rid of '-0' and enforce stricter checks on
the parameters to rule out valid numeric values that look funny, which
in the '0*\d' cases it should be fairly simple.

  -Joao
--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: parsing in the ceph osd subsystem

2012-11-29 Thread Joao Eduardo Luis
On 11/29/2012 07:01 PM, Andrey Korolyov wrote:
 On Thu, Nov 29, 2012 at 8:34 PM, Sage Weil s...@inktank.com wrote:
 On Thu, 29 Nov 2012, Andrey Korolyov wrote:
 $ ceph osd down -
 osd.0 is already down
 $ ceph osd down ---
 osd.0 is already down

 the same for ``+'', ``/'', ``%'' and so - I think that for osd subsys
 ceph cli should explicitly work only with positive integers plus zero,
 refusing all other input.

 which branch is this?  this parsing is cleaned u pin the latest
 next/master.


 
 It was produced by 0.54-tag. I have built
 dd3a24a647d0b0f1153cf1b102ed1f51d51be2f2 today and problem has
 gone(except parsing ``-0'' as 0 and 0/001 as 0 and 1
 correspondingly).

A fix for the signed parameter has been pushed to next. However, after
consideration, when it comes to the '0+\d' parameters, that kind of
input was considered valid; Greg put it best on IRC, and I quote:

gregaf joao: not sure we want to prevent 01 from parsing as 1, I
suspect some people with large clusters will find that useful so they
can conflate the name and ID while keeping everything three digits

Hope this makes sense to you.

  -Joao
--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: parsing in the ceph osd subsystem

2012-11-28 Thread Gregory Farnum
On Wednesday, November 28, 2012 at 11:45 PM, Andrey Korolyov wrote:
 $ ceph osd down -
 osd.0 is already down
 $ ceph osd down ---
 osd.0 is already down
 
 the same for ``+'', ``/'', ``%'' and so - I think that for osd subsys
 ceph cli should explicitly work only with positive integers plus zero,
 refusing all other input.

 
Yes indeed! This is already fixed in bobtail (and v0.54, maybe?), and I believe 
Joao went through and audited all our input parsing pretty carefully. Certainly 
things are much better than they were.
-Greg


--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html