<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 6:17 PM, Eric Sandeen <span dir="ltr"><<a href="mailto:sandeen@sandeen.net" target="_blank">sandeen@sandeen.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 4/13/16 10:08 AM, Jan Tulak wrote:<br>
<br>
...<br>
<span><br>
> All right​, I will keep the O_TRUNC there. However, should it<br>
> truncate the file every time, or should we offer a way how to avoid<br>
> the file truncating? Until now, mkfs behaved differently based on<br>
> whether -d file was given, or not. Your explanation suggests that we<br>
> should truncate every time, right?<br>
<br>
</span>There are probably valid reasons to keep size as well as to truncate;<br>
it's not immediately clear to me how we should handle it.<br>
<br>
Honestly, at this point, in the interest of getting the other fixes in,<br>
I think I might rather see the truncating behavior unchanged from what<br>
we have today; we can tackle that as a separate problem at a later date.<br>
<br>
What do you think?<br>
<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​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 <span style="color:rgb(80,0,80);font-size:12.8px;font-family:arial,sans-serif">the combo check. So this should be no big issue... I will look on this tomorrow, to know better.</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(80,0,80);font-size:12.8px;font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(80,0,80);font-size:12.8px;font-family:arial,sans-serif">Cheers,</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(80,0,80);font-size:12.8px;font-family:arial,sans-serif">Jan</span></div><br></div><div><br></div></div><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>Jan Tulak<br></div><a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a> / <a href="mailto:jan@tulak.me" target="_blank">jan@tulak.me</a></div></div></div></div>
</div></div>