]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: make sure group number is bumped after a inode allocation race
authorTheodore Ts'o <tytso@mit.edu>
Fri, 26 Jul 2013 19:15:46 +0000 (15:15 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 26 Jul 2013 19:15:46 +0000 (15:15 -0400)
commit9b0d3230c7dd14760177e1253c76709aa2ac8201
treea03b17e804bc3ddfca87b57d9cff435b41c0db8a
parenta3079e9139cd68a2ce172277272f72e0aa13bdb1
ext4: make sure group number is bumped after a inode allocation race

When we try to allocate an inode, and there is a race between two
CPU's trying to grab the same inode, _and_ this inode is the last free
inode in the block group, make sure the group number is bumped before
we continue searching the rest of the block groups.  Otherwise, we end
up searching the current block group twice, and we end up skipping
searching the last block group.  So in the unlikely situation where
almost all of the inodes are allocated, it's possible that we will
return ENOSPC even though there might be free inodes in that last
block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
fs/ext4/ialloc.c