Skip to content

Commit 878f2d2

Browse files
fdmananamasoncl
authored andcommitted
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 <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 12cfbad commit 878f2d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/dir-item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir,
261261
* see if there is room in the item to insert this
262262
* name
263263
*/
264-
data_size = sizeof(*di) + name_len + sizeof(struct btrfs_item);
264+
data_size = sizeof(*di) + name_len;
265265
leaf = path->nodes[0];
266266
slot = path->slots[0];
267267
if (data_size + btrfs_item_size_nr(leaf, slot) +

0 commit comments

Comments
 (0)