diff options
author | Filipe David Borba Manana <fdmanana@gmail.com> | 2013-11-27 11:06:16 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 16:19:49 -0500 |
commit | 878f2d2cb355da2dabbffb2ae51b7541a91ce4e3 (patch) | |
tree | ef1594fbaf8e1f750f1603598a218eb7c16ee5cf | |
parent | 12cfbad90e02793b7a71b7591ebd5c3f9228dc5d (diff) |
Btrfs: fix max dir item size calculation
We were accounting for sizeof(struct btrfs_item) twice, once
in the data_size variable and another time in the if statement
below.
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | fs/btrfs/dir-item.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index c031ea3fd70f..9a89ceb25e83 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
@@ -261,7 +261,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir, | |||
261 | * see if there is room in the item to insert this | 261 | * see if there is room in the item to insert this |
262 | * name | 262 | * name |
263 | */ | 263 | */ |
264 | data_size = sizeof(*di) + name_len + sizeof(struct btrfs_item); | 264 | data_size = sizeof(*di) + name_len; |
265 | leaf = path->nodes[0]; | 265 | leaf = path->nodes[0]; |
266 | slot = path->slots[0]; | 266 | slot = path->slots[0]; |
267 | if (data_size + btrfs_item_size_nr(leaf, slot) + | 267 | if (data_size + btrfs_item_size_nr(leaf, slot) + |