All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Jan Tulak <jtulak@redhat.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [xfsprogs] Do we need so many data types for user input?
Date: Wed, 5 Apr 2017 09:08:27 -0500	[thread overview]
Message-ID: <83915e74-6198-4b0a-9aff-96cdedfad97a@sandeen.net> (raw)
In-Reply-To: <CACj3i73u11rNPK701aVm07qOPpT2r-1r_m--iW-D6SwLfb-pbw@mail.gmail.com>


On 4/5/17 3:26 AM, Jan Tulak wrote:
> On Tue, Apr 4, 2017 at 10:17 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
>> On 4/4/17 2:48 PM, Luis R. Rodriguez wrote:
>>>
>>> And then agsize is capped artificially later via validate_ag_geometry():
>>>
>>>         if (agsize < XFS_AG_MIN_BLOCKS(blocklog)) {
>>>               ...
>>>       if (agsize > XFS_AG_MAX_BLOCKS(blocklog)) {
>>>               ...
>>>       if (agsize > dblocks) {
>>>               ...
>>>       if (agsize > XFS_AG_MAX_BLOCKS(blocklog)) {
>>>               ...
>>>
>>> Its not clear if this is capped at UINT_MAX or if we need ULLONG_MAX here.
>>
>> .maxval = XFS_AG_MAX_BYTES,
>>
>> #define XFS_AG_MAX_BYTES        ((XFS_AG_BYTES(31)))    /* 1 TB */
>> #define XFS_AG_BYTES(bblog)     ((long long)BBSIZE << (bblog))
>>
>> so the maximum is (long long)(512) << 31
>>
>> so, no - agsize won't fit in a 32 bit var, if that's the question...
>>
> 
> Yeah. I think that we can make it uint64 everywhere unless it is
> causing an issue in a specific case with a bit shift or something, and
> just limit the input value where appropriate explicitly.
> 
> 
> And...
>> And at the end of the day, we are converting all numbers into unsigned
> 
> I take back this part, we are going through long long, not unsigned long long.
> Everything else is still valid.

Ok, for those who aren't immersed 24/7 in mkfs ;) can you help us understand
where you're going with this?  What's the change you're proposing, and how
does it help?

Thanks,
-Eric

> Jan
> 

  reply	other threads:[~2017-04-05 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  8:54 [xfsprogs] Do we need so many data types for user input? Jan Tulak
2017-04-04 19:48 ` Luis R. Rodriguez
2017-04-04 20:17   ` Eric Sandeen
2017-04-05  8:26     ` Jan Tulak
2017-04-05 14:08       ` Eric Sandeen [this message]
2017-04-05 14:24         ` Jan Tulak
2017-04-06 12:40           ` Luis R. Rodriguez
2017-04-06 13:03             ` Jan Tulak
2017-04-05 12:15   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83915e74-6198-4b0a-9aff-96cdedfad97a@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=jtulak@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.