Re: Files full of zeros with coreutils-8.11 and xfs (FIEMAP related?)
From:
Yongqiang Yang
Subject:
Re: Files full of zeros with coreutils-8.11 and xfs (FIEMAP related?)
Date:
Thu, 5 May 2011 19:47:29 +0800
2011/5/5 Pádraig Brady <address@hidden>:
> On 14/04/11 17:10, Yongqiang Yang wrote:
>> Hi,
>>
>> I am off my working computer. Â Maybe below fix could fix the problem.
>>
>> fs/ext4/extent.c
>> static int ext4_ext_walk_space(struct inode *inode, ext4_lblk_t block,
>> 1877 Â Â Â Â Â Â Â Â } else if (block >= le32_to_cpu(ex->ee_block)) {
>> 1878 Â Â Â Â Â Â Â Â Â Â Â Â /*
>> 1879 Â Â Â Â Â Â Â Â Â Â Â Â Â * some part of requested space is covered
>> 1880 Â Â Â Â Â Â Â Â Â Â Â Â Â * by found extent
>> 1881 Â Â Â Â Â Â Â Â Â Â Â Â Â */
>> 1882 Â Â Â Â Â Â Â Â Â Â Â Â start = block;
>> 1883 Â Â Â Â Â Â Â Â Â Â Â Â end = le32_to_cpu(ex->ee_block)
>> 1884 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â + ext4_ext_get_actual_len(ex);
>> 1885 Â Â Â Â Â Â Â Â Â Â Â Â if (block + num < end)
>> 1886 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end = block + num;
>> Â Â Â Â + Â Â Â Â Â Â Â Â Â Â Â Â if (!ext4_ext_is_uninitialized(ex))
>> 1887 Â Â Â Â Â Â Â Â Â Â Â Â exists = 1;
>> 1888 Â Â Â Â Â Â Â Â } else {
>> 1889 Â Â Â Â Â Â Â Â Â Â Â Â BUG();
>> 1890 Â Â Â Â Â Â Â Â }
>
> Hi,
>
> To follow up on the above. Â I'm under the impression
> that ext4 is expected to return extents for what
> is written, irrespective of whether it's reached the
> disk or not. I.E. the preallocation case where this fails
No. It just returns extent info now - allocated extents and delayed
extents. In the preallocation case, it returns unwritten extents.
And the code above does not work.
> was an oversite, for which the above might fix.
>
> So is the above summary correct, and has there
> been any more thoughts on a fix?
>
> cheers,
> Pádraig.
>
--
Best Wishes
Yongqiang Yang