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)
commit340174722929d80a107120400bab527cfc7e47f1
tree0385ac25db0991a4da1975bac80be03cf8ca64c3
parent2aba1b5b4f78d56a764b92bae58298ad3fffdc4a
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