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

freeing, allocating and free blocks in Ext3


We hit an interesting issue with Ext3 in ordered data mode.  A large file
was truncated (open with O_TRUNC) and immediately over-written with a
single write call.  The write call returned ENOSPACE, but a check for
space (using essentially statfs) promised that there would be plenty of

The reason turned out to be that the blocks freed by the truncation were
not yet available to the write because the transaction had not committed.  
The total number of blocks write required in addition to what was made
unavailable by the truncate transaction exceeded the size of this
(admittedly small) ext3 file system.  So ext3_getblk bummed out.

What does worry me is that the superblock information indicating available
blocks is simply incorrect until the truncate transaction has committed.  
I wonder if we could either change that, or maintain a constant that
indicates how many blocks are unavailable until the next commit.

Is this easy to do?  I think it probably is. 


- Peter -

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