archive mirror
 help / color / mirror / Atom feed
* [patch 8/11] btrfs: btrfs_lookup_dir_item() can return ERR_PTR
@ 2010-05-29  9:47 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-05-29  9:47 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Yan Zheng, Josef Bacik, Sage Weil, Chris Mason, kernel-janitors

btrfs_lookup_dir_item() can return either ERR_PTRs or null.

Signed-off-by: Dan Carpenter <>

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 9f9a1d9..4dbaf89 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -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_end_transaction(trans, root);
 		printk(KERN_ERR "Umm, you don't have the default dir item, "

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-29  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29  9:47 [patch 8/11] btrfs: btrfs_lookup_dir_item() can return ERR_PTR Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).