Re: [PATCH 2/2] Btrfs: fix wrong i_size when truncating a file to a larger size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 14 Dec 2011 11:51:47 -0500, Chris Mason wrote:
> On Wed, Dec 14, 2011 at 03:15:53PM +0800, Miao Xie wrote:
>> Btrfsck report error 100 after the 83th case of xfstests was run, it means
>> the i_size of the file is wrong.
>>
>> The reason of this bug is that:
>> Btrfs increased i_size of the file at the beginning, but it failed to expand
>> the file, and failed to update the i_size to the old size because there is no
>> enough space in the file system, so we found a wrong i_size.
>>
>> This patch fixes this bug by updating the i_size just when we pass the file
>> expanding and get enough space to update i-node.
> 
> Hmmm, have you tested this one with fsx-linux?  It should be ok to call
> truncate_pagecache before bumping i_size in this case, since we
> shouldn't have pages past i_size.

Yes, I have tested it. Everything is OK.

> But, truncate_pagecache does expect i_size to be accurate before the
> call.

OK, I will modify my patch.

Thanks for your comment.
Miao

> 
> -chris
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux