diff options
author | Filipe Manana <fdmanana@suse.com> | 2015-02-23 19:48:52 (GMT) |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-03-02 22:04:45 (GMT) |
commit | 5dfe2be7ead15863fd7b3fcc8bd69e470fae2bec (patch) | |
tree | a0f3398927bcd6e15a7347f741b186eb85cf3fc1 /fs/jfs/jfs_inode.c | |
parent | e8c1c76e804b18120e6977fc092769c043876212 (diff) | |
download | linux-5dfe2be7ead15863fd7b3fcc8bd69e470fae2bec.tar.xz |
Btrfs: fix off-by-one logic error in btrfs_realloc_node
The end_slot variable actually matches the number of pointers in the
node and not the last slot (which is 'nritems - 1'). Therefore in order
to check that the current slot in the for loop doesn't match the last
one, the correct logic is to check if 'i' is less than 'end_slot - 1'
and not 'end_slot - 2'.
Fix this and set end_slot to be 'nritems - 1', as it's less confusing
since the variable name implies it's inclusive rather then exclusive.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/jfs/jfs_inode.c')
0 files changed, 0 insertions, 0 deletions