From patchwork Sat May 29 09:47:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 103028 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4T9lkBT027069 for ; Sat, 29 May 2010 09:47:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751816Ab0E2Jro (ORCPT ); Sat, 29 May 2010 05:47:44 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:60271 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173Ab0E2Jrm (ORCPT ); Sat, 29 May 2010 05:47:42 -0400 Received: by ewy8 with SMTP id 8so555320ewy.28 for ; Sat, 29 May 2010 02:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=CJGkLrIsl80Gj0bhL43p4K040Y4eHRPcBRQ8HVicLAA=; b=V+5s11wrp50XaI+EJeXdSxGxCrTdmJ9X9Pq0BytcHuRGgaMmFEu/5vQvKBpI5it11G nVD0w4rX28skbMAyWJRGVD/SLJCVzdtSWLM689KHDtJlOBpc2hJpL4Ed7uVdTl4Sldyb I4pPkAB6jDZuLOJDcAUQ3wTAiDUtngOpkzCTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=sQaUTFGSznXmZT3dpHqwDO3DvdwcUjR9ZvTnLNOh4rEFdmmr/eGLZQLG7Bpmc2PlTZ cJxgeweIDLmugN4MN2n7814LDRFML7ro2DQLYaO/b5unsCXicNxWWsChoz2OS19kwFSI j+AJdAl6/v1VYEh7J3bmgwvdSy9kttUhWePOM= Received: by 10.213.26.75 with SMTP id d11mr778899ebc.90.1275126460887; Sat, 29 May 2010 02:47:40 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 14sm1726026ewy.14.2010.05.29.02.47.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 May 2010 02:47:40 -0700 (PDT) Date: Sat, 29 May 2010 11:47:24 +0200 From: Dan Carpenter To: linux-btrfs@vger.kernel.org Cc: Yan Zheng , Josef Bacik , Sage Weil , Chris Mason , kernel-janitors@vger.kernel.org Subject: [patch 8/11] btrfs: btrfs_lookup_dir_item() can return ERR_PTR Message-ID: <20100529094724.GI5483@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 29 May 2010 09:47:46 +0000 (UTC) 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_free_path(path); btrfs_end_transaction(trans, root); printk(KERN_ERR "Umm, you don't have the default dir item, "