summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorStephen C. Tweedie <sct@redhat.com>2005-03-28 04:00:38 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-28 04:00:38 -0800
commitc09ce22cae6c775e7733a4798a44e6ef727a6e5a (patch)
treedbbbb1932d87cec3d3215ae3f0ba92bb2ce0876b /kernel
parent7b8f061e04e3090a40f2828434f17c9003013cc7 (diff)
[PATCH] ext2/3 file limits to avoid overflowing i_blocks
As discussed before, we can overflow i_blocks in ext2/ext3 inodes by growing a file up to 2TB. That gives us 2^32 sectors of data in the file; but once you add on the indirect tree and possible EA/ACL metadata, i_blocks will wrap beyond 2^32. Consensus seemed to be that the best way to avoid this was simply to stop files getting so large that this was a problem in the first place; anything else would lead to complications if a sparse file tried to overflow that 2^32 sector limit while filling in holes. I wrote a small program to calculate the total indirect tree overhead for any given file size, and 0x1ff7fffe000 turned out to be the largest file we can get without the total i_blocks overflowing 2^32. But in testing, that *just* wrapped --- we need to limit the file to be one page smaller than that to deal with the possibility of an EA/ACL block being accounted against i_blocks. So this patch has been tested, at least on ext3, by letting a file grow densely to its maximum size permitted by the kernel; at 0x1ff7fffe000, stat shows the file to have wrapped back exactly to 0 st_blocks, but with the limit at 0x1ff7fffd000, du shows it occupying the expected 2TB-blocksize bytes. Signed-off-by: Stephen Tweedie <sct@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions