2007/9/18, Chris Mason <[EMAIL PROTECTED]>:
> >
> > Thanks for the clarification
> >
> > Yes, I'm wrong.  But during test the non-exist bug, I have a new
> > discovery. It's seem there is a race between the truncate operation
> > and the delay allocation.  The output of 'ls -s' looks strange, when
> > the truncate operation is before allocation really happen.
> >
> Odd, the i_blocks changes happen inside file_write, not at delalloc
> time.  Could you please try to narrow the problem down?
> -chris
>
When allocation doesn't really happen, there is no extent item. So
btrfs_truncate_in_trans finds nothing and i_blocks isn't updated.

following is  the output of my test.
[EMAIL PROTECTED] btrfs]$ dd if=/dev/zero bs=1M count=1 of=test; sync;
>test; ls -s test
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0104944 s, 99.9 MB/s
0 test
[EMAIL PROTECTED] btrfs]$ dd if=/dev/zero bs=1M count=1 of=test; >test;
sync; ls -s test
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00260587 s, 402 MB/s
1024 test

Regards
YZ

_______________________________________________
Btrfs-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/btrfs-devel

Reply via email to