Re: [PATCH 2/2] mkfs: Show progress during block discard

Eric Sandeen
2019-11-22T21:19:19Z

On 11/22/19 10:43 AM, Pavel Reichl wrote:
> On Fri, Nov 22, 2019 at 12:42 AM Dave Chinner <david@fromorbit.com> wrote:
>>
>> On Thu, Nov 21, 2019 at 10:44:45PM +0100, Pavel Reichl wrote:
...

>>
>> I also suspect that it breaks a few fstests, too, as a some of them
>> capture and filter mkfs output. They'll need filters to drop these
>> new messages.
>>
>> FWIW, a 100 lines of extra mkfs output is going to cause workflow
>> issues. I know it will cause me problems, because I often mkfs 500TB
>> filesystems tens of times a day on a discard enabled device. This
>> extra output will scroll all the context of the previous test run
>> I'm about to compare against off my terminal screen and so now I
>> will have to scroll the terminal to look at the results of
>> back-to-back runs. IOWs, I'm going to immediately want to turn this
>> output off and have it stay off permanently.
>>
>> Hence I think that, by default, just outputting a single "Discard in
>> progress" line before starting the discard would be sufficient

e2fsprogs simply does:

Discarding device blocks: done

("done" isn't printed until it's ... done)

so that might be a good convention to follow? Though I'd probably do

printf("Discarding blocks... ");
....
printf("Done.\n");

because the ellipses tend to indicate waiting. :)

Even the one line might require filtering-out in xfstests, but luckily we have
standard filters and it should be trivial to add.

> OK, maybe just one line "Discard in progress" is actually what users
> need. The computing of % done was probably just overkill from my side.
> Sorry about that.

No worries, that's why we discuss stuff. :)
Thanks for taking this on,

-Eric