summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dir-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-30 08:47:31 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-30 08:47:31 -0400
commit22b0ebda6c63a1ad66b6a9e806bd226a4a03a049 (patch)
tree391d141c7c143914969a98409e72e615cdcac226 /fs/btrfs/dir-item.c
parentf254e52c1ce550fdaa0d31f5e068f0d67c2485d4 (diff)
downloadblackbird-op-linux-22b0ebda6c63a1ad66b6a9e806bd226a4a03a049.tar.gz
blackbird-op-linux-22b0ebda6c63a1ad66b6a9e806bd226a4a03a049.zip
Btrfs: hunting slab corruption
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r--fs/btrfs/dir-item.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index c18f81797a88..18d3e168ad0a 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -35,6 +35,8 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_dir_name_len(dir_item, name_len);
name_ptr = (char *)(dir_item + 1);
memcpy(name_ptr, name, name_len);
+ if (name_ptr + name_len > path.nodes[0]->b_data + 4096)
+ WARN_ON(1);
mark_buffer_dirty(path.nodes[0]);
out:
btrfs_release_path(root, &path);
OpenPOWER on IntegriCloud