<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Wed, Apr 6, 2016 at 11:42 PM, Eric Sandeen </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:sandeen@sandeen.net" target="_blank">sandeen@sandeen.net</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 3/24/16 6:15 AM, <a href="mailto:jtulak@redhat.com">jtulak@redhat.com</a> wrote:<br>
> From: Jan Tulak <<a href="mailto:jtulak@redhat.com">jtulak@redhat.com</a>><br>
><br>
> Unify mkfs.xfs behaviour a bit and never truncate files. If the user<br>
> is trying to mkfs an existing file, we don't want to destroy anything<br>
> he did with the file before (sparse file, allocations...)<br>
<br>
</span>Hm, I guess so ... What motivated this change? I see that it<br>
changes behavior, but I'm not sure what it unifies or fixes -<br>
can you explain more?<br>
<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Both, I think. The non-truncating is a new change, a fix of undesired side effects, where user lost his changes to the file, like sparse file... The rest should be unifying the behavior w.r.t. mkfs arguments. Do you think that the O_TRUNC change should be a separate patch?</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="im trimless-h5 trimless-content"><br>
> + if (*isfile && statres != 0 && (no_size || no_name)) {<br>
<br>
</div></div>statres !=0 doesn't imply ENOENT; it could be EACCES<br>
or several other errors. You'd need to check errno to know<br>
for sure.<br><br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Well, then I need to print two errors. One if the file doesn't exists, but additional arguments will fix it, and one for other cases, where I will print the specific error... </div></div></div><div class="gmail_extra"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Cheers,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Jan</div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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>