Btrfs: btrfs_lookup_dir_item() can return ERR_PTR
authorDan Carpenter <error27@gmail.com>
Sat, 29 May 2010 09:47:24 +0000 (09:47 +0000)
committerChris Mason <chris.mason@oracle.com>
Fri, 11 Jun 2010 19:57:37 +0000 (15:57 -0400)
btrfs_lookup_dir_item() can return either ERR_PTRs or null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c

index 9f9a1d9607a73803e192d452f2eac4d7e70781c4..4dbaf89b1337632ac7800b84b183d6cd0ab14242 100644 (file)
@@ -1845,7 +1845,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
        dir_id = btrfs_super_root_dir(&root->fs_info->super_copy);
        di = btrfs_lookup_dir_item(trans, root->fs_info->tree_root, path,
                                   dir_id, "default", 7, 1);
-       if (!di) {
+       if (IS_ERR_OR_NULL(di)) {
                btrfs_free_path(path);
                btrfs_end_transaction(trans, root);
                printk(KERN_ERR "Umm, you don't have the default dir item, "