Re: [PATCH 17/19] xfsprogs: disable truncating of files

Jan Tulak
2016-04-13T16:23:49Z

[-- Attachment #1.1: Type: text/plain, Size: 1340 bytes --]

On Wed, Apr 13, 2016 at 6:17 PM, Eric Sandeen <sandeen@sandeen.net> wrote:

> On 4/13/16 10:08 AM, Jan Tulak wrote:
>
> ...
>
> > All right​, I will keep the O_TRUNC there. However, should it
> > truncate the file every time, or should we offer a way how to avoid
> > the file truncating? Until now, mkfs behaved differently based on
> > whether -d file was given, or not. Your explanation suggests that we
> > should truncate every time, right?
>
> There are probably valid reasons to keep size as well as to truncate;
> it's not immediately clear to me how we should handle it.
>
> Honestly, at this point, in the interest of getting the other fixes in,
> I think I might rather see the truncating behavior unchanged from what
> we have today; we can tackle that as a separate problem at a later date.
>
> What do you think?
>
> ​For keeping the size, the easiest way might be to implicitly set xi.dsize
(or whatever) to the current size. Of course, after a check for -d
file,name,size combo. AFAIK (without looking to the code, I'm just ending
for today and in the middle of shutting everything down :-) ), we ​do the
truncation after the combo check. So this should be no big issue... I will
look on this tomorrow, to know better.

Cheers,
Jan

--
Jan Tulak
jtulak@redhat.com / jan@tulak.me

[-- Attachment #1.2: Type: text/html, Size: 2731 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]