]> git.baikalelectronics.ru Git - kernel.git/commit
GFS2: make sure fallocate bytes is a multiple of blksize
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 26 Apr 2011 06:13:24 +0000 (01:13 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 3 May 2011 10:47:42 +0000 (11:47 +0100)
commitd7d06fbcb0bfd79a1b95c8113d25aa6a2a58162b
treed0a13a80a31c18ac148f678450e045196066eb06
parent343dc050519419e16d8d4db5d3ddad01b3796105
GFS2: make sure fallocate bytes is a multiple of blksize

The GFS2 fallocate code chooses a target size to for allocating chunks of
space.  Whenever it can't find any resource groups with enough space free, it
halves its target. Since this target is in bytes, eventually it will no longer
be a multiple of blksize.  As long as there is more space available in the
resource group than the target, this isn't a problem, since gfs2 will use the
actual space available, which is always a multiple of blksize.  However,
when gfs couldn't fallocate a bigger chunk than the target, it was using the
non-blksize aligned number. This caused a BUG in later code that required
blksize aligned offsets.  GFS2 now ensures that bytes is always a multiple of
blksize

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/file.c