<div dir="auto">Thoughts? Should I just pick a number and send a patch?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 28, 2019, 09:46 enh <<a href="mailto:enh@google.com">enh@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">the only other idea i've had since: use perl or python to implement #4<br>
inline. but there's no perl or python on Android devices, and there's<br>
no way that i know of to SEEK_HOLE/SEEK_DATA in awk. so that seems<br>
like a non-starter.<br>
<br>
On Thu, Sep 26, 2019 at 5:58 PM enh <<a href="mailto:enh@google.com" target="_blank" rel="noreferrer">enh@google.com</a>> wrote:<br>
><br>
> I shot myself in the foot with my tar test that checks both st_size and st_blocks (via stat(1)). You may remember that I had to add a "don't run these tests on a system with SELinux xattrs" hack to the du tests. Basically, any test of st_blocks will be broken because of SELinux.<br>
><br>
> Unlike the du tests, I don't want to disable this tar sparse test unless I have to. But I don't have any non-terrible options.<br>
><br>
> 1. Disable the test for SELinux.<br>
><br>
> 2. Use shell arithmetic to allow some fudge.<br>
><br>
> 3. Use setxattr to try to ensure that we're always using extra space, but then we need to work around failures on file systems without xattrs, and how much is enough, and...<br>
><br>
> 4. Invent a new tool that actually dumps a map of where the holes are in a file. Unfortunately I'm not aware of any existing tool we could use, so then the test relies on toybox already being installed.<br>
><br>
> 5. Use find -printf %S but because that's just using st_blocks behind the scenes, we'd need a fudge factor only now it would be a float instead of an int, which doesn't seem like an improvement.<br>
><br>
> I haven't been able to come up with anything else, and I don't like any of those options, so ... anyone have a better idea?<br>
><br>
> If not, 1 or 2 seem like the least awful. Let me know which you prefer, if you don't have a good solution I haven't thought of...<br>
</blockquote></div>