]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: keep offset when splitting dir leaf blocks
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 1 Dec 2015 14:30:34 +0000 (08:30 -0600)
committerBob Peterson <rpeterso@redhat.com>
Mon, 14 Dec 2015 18:19:34 +0000 (12:19 -0600)
commit78003f3db2095f34f00108860da0654c17001cce
tree0385ac25db0991a4da1975bac80be03cf8ca64c3
parent7272ef122cf1ad54c0a99ff2339bc1a8ad21a103
gfs2: keep offset when splitting dir leaf blocks

Currently, when gfs2 splits a directory leaf block, the dirents that
need to be copied to the new leaf block are packed into the start of it.
This is good for space efficiency. However, if gfs2 were to copy those
dirents into the exact same offset in the new leaf block as they had in
the old block, it would be able to generate a readdir cookie based on
the dirent location, that would be guaranteed to be unique up well past
where the current code is statistically almost guaranteed to have
collisions. So, gfs2 now keeps the dirent's offset in the block the
same when it copies it to the new leaf block.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/dir.c