We should always check btrfs_alloc_path(). Some places BUG(),
others return -ENOMEM, btrfs_insert_dir_item() seems like it can return
safely.

Signed-off-by: Diego Calleja <dieg...@gmail.com>

--- linux/fs/btrfs/dir-item.c.BAK       2009-10-06 19:00:48.887361896 +0200
+++ linux/fs/btrfs/dir-item.c   2009-10-06 19:01:00.329132291 +0200
@@ -147,6 +147,9 @@ int btrfs_insert_dir_item(struct btrfs_t
        key.offset = btrfs_name_hash(name, name_len);
 
        path = btrfs_alloc_path();
+       if (!path)
+               return -ENOMEM;
+
        path->leave_spinning = 1;
 
        data_size = sizeof(*dir_item) + name_len;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to