[Ocfs2-tools-devel] [PATCH 4/6] Fix filesize in create_file

Sunil Mushran sunil.mushran at oracle.com
Wed Nov 9 14:01:11 PST 2011


On 11/08/2011 08:07 PM, Goldwyn Rodrigues wrote:
> On Wed, Oct 26, 2011 at 2:21 AM, Sunil Mushran<sunil.mushran at oracle.com>  wrote:
>> I am confused. create_file() merely creates a file and adds it
>> to a directory. It dies not allocate any space to it. The file size
>> should be zero.
> Hmm, I lost my previous work. However, AFAIR create_file used to
> create a file with size as zero and with exactly one extent. I am
> unable to reproduce it now.
>
> Using the latest ocfs2-tools, fswreck is failing much before this
> (local,noinline-data):
>
> goldwyn at shrek:~/repos/ocfs2-tools>  sudo ./fswreck/fswreck -c
> INODE_SIZE /dev/sda10
> fswreck 1.8.0
> fswreck: Directory entry not found (corrupt.c,42)
>
> This needs more time and effort and I will check after I get back from
> my vacation.
>

fswreck is failing because of another reason. I have fixed it. Will email that later.
And I confirmed, the file is created with zero extents. However, fsck does not
fix it because the INODE_SIZE check is _not_ performed on volumes having the
sparse feature enabled. It does INODE_SPARSE_SIZE check which ensures i_size
not to be less than the totally allocated size. We have to also ensure the i_size is
not greater than the largest cpos+clustersize.

Thoughts?



More information about the Ocfs2-tools-devel mailing list