summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/xattr.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2017-08-30 09:26:09 -0500
committerBob Peterson <rpeterso@redhat.com>2017-08-30 13:29:22 -0500
commitc4a9d1892f1ce6fe040b717b68bd21e689cc2410 (patch)
tree318a7c5a9566218c32e543a28b7e6e3d734f5fcf /fs/gfs2/xattr.c
parentd296b15ed58231bd991c0fb0f3592d595539bcd1 (diff)
downloadlinux-c4a9d1892f1ce6fe040b717b68bd21e689cc2410.tar.bz2
GFS2: Fix non-recursive truncate bug
Before this patch if you truncated a file to a smaller size it wasn't freeing all the blocks properly. There are two reasons. First, the metapath comparison was not comparing previous heights. I added a function, mp_eq_to_hgt, which checks the metapath at all heights prior to the target height. Second, in function find_nonnull_ptr, it needed to zero out all pointers for heights following the target height. Translated into decimal integer terms, this way a number like 299, when incremented, becomes 300, not 399. The 2 gets incremented to 3, and the following digits need to be reset. These two things allow the truncate state machine to properly find the blocks it needs to delete. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/xattr.c')
0 files changed, 0 insertions, 0 deletions