From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs: clean up xfs_set_maxicount & use in growfs
Date: Thu, 27 Feb 2014 08:08:45 -0600 [thread overview]
Message-ID: <530F46ED.9010006@sandeen.net> (raw)
In-Reply-To: <20140227071154.GK29907@dastard>
On 2/27/14, 1:11 AM, Dave Chinner wrote:
> On Wed, Feb 26, 2014 at 12:29:22PM -0600, Eric Sandeen wrote:
>> On 2/25/14, 8:11 PM, Christoph Hellwig wrote:
>>> On Mon, Feb 24, 2014 at 11:27:35PM -0600, Eric Sandeen wrote:
>>>> xfs_set_maxicount() overflowed fairly easily for large filesystems
>>>> and large maxicount; we started out by multiplying dblocks by
>>>> the percentage, *then* dividing by 100, and never checked for
>>>> an overflow. The calculations were also, IMHO, a little hard
>>>> to follow.
>>>
>>> Would be useful to get this test case into xfstests..
>>
>> Ok so I was going on Dave's assertion about that. ;)
>>
>> To overflow, we'd need dblocks * 100 to be > 2^64-1:
>>
>> so dblocks would need to be > (2^64-1)/100
>>
>> for 4k blocks that's 655 exabytes. Maybe not so possible after all ;)
>
> Until the block count is corrupted by fsfuzzer? ;)
>
>> Dave, maybe just removing the open-code is enough here.
>
> Sure, but I still like the conversion to use mult_frac....
Ok, I do too. Just a bit resistant to fixing what ain't
broke. I'll see if I can write up a test to be sure we're
doing sane things statfs/growfs with the change.
-Eric
> Cheers,
>
> Dave.
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2014-02-27 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 5:27 [PATCH] xfs: clean up xfs_set_maxicount & use in growfs Eric Sandeen
2014-02-26 2:11 ` Christoph Hellwig
2014-02-26 2:18 ` Eric Sandeen
2014-02-26 18:29 ` Eric Sandeen
2014-02-27 7:11 ` Dave Chinner
2014-02-27 14:08 ` Eric Sandeen [this message]
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=530F46ED.9010006@sandeen.net \
--to=sandeen@sandeen.net \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=sandeen@redhat.com \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox