<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Thu, Apr 21, 2016 at 11:39 AM, Jan Tulak </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">From: Dave Chinner <<a href="mailto:dchinner@redhat.com">dchinner@redhat.com</a>><br>
<br>
THIS PATCH HAS KNOWN ISSUES - it fails xfs/206 and xfs/216 tests, as it<br>
shrinks a file instead just not using it entirely, when -d size is used.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​So the shrinking is happening here:</div></div><div><font face="arial, helvetica, sans-serif">3127        /*</font></div><div><font face="arial, helvetica, sans-serif">3128         * If the data area is a file, then grow it out to its final size</font></div><div><font face="arial, helvetica, sans-serif">3129         * so that the reads for the end of the device in the mount code</font></div><div><font face="arial, helvetica, sans-serif">3130         * will succeed.</font></div><div><font face="arial, helvetica, sans-serif">3131         */</font></div><div><div class="gmail_default" style="display:inline"><font face="arial, helvetica, sans-serif">3132        if (xi.disfile && ftruncate64(xi.dfd, dblocks * blocksize) < 0) {​</font></div> </div><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Before the patch, xi.disfile was 0 and so it didn't shrink the file to the size of the new FS.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Now, what is the correct solve to this? Tests are written for the old behaviour, but this shrinking seems to be an intentional thing.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It seems that the FS works ok even when this truncating is not applied, so I think that I should remove this chunk (or change it to xi.dcreate=1 only), and keep the old behaviour.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">What do you think about it, guys?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><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></div><div><br></div></div><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>