From patchwork Wed Apr 21 10:32:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 93846 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 o3LAWkZl018304 for ; Wed, 21 Apr 2010 10:32:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040Ab0DUKcf (ORCPT ); Wed, 21 Apr 2010 06:32:35 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:46513 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964Ab0DUKce (ORCPT ); Wed, 21 Apr 2010 06:32:34 -0400 Received: by wyb39 with SMTP id 39so3917146wyb.19 for ; Wed, 21 Apr 2010 03:32:32 -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=I7zgyQFIhQDkXBIL1VpoGMsH9hpINLWW7IEN5SnAtTg=; b=FaRNlDb6ZsGfUOVqcrgva4Y7wTKY7yhekw0Ae2n4hfteHoocduV6xeKY8HnBpBDkvm OoICbymTGXQzaz5gU5nRAvz4d6cmmCQlPPyG2/Q0joepJCNl55FtbzMbUjaSOkWJ3LE0 JqAogkEzd8ZvSHeRSIIrBFkG0UIIM58s2Jyf0= 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=wvdK6KxO07nNVsa7q7BuO+MNIrcswT22dnAsOpLTHNHleG2p1jrzxTpGpOs/GjbMIO FPregMJhSypqPOM6tabuITzJhzSds7IFQxnB76IXE8Cxj31ySqGLebUw+6YiGFsCYgJb LouKQxM9y+7H6TDhHZDtb+O9o4KrGwHeSiNbY= Received: by 10.216.88.208 with SMTP id a58mr1404012wef.35.1271845952470; Wed, 21 Apr 2010 03:32:32 -0700 (PDT) Received: from bicker ([41.222.20.196]) by mx.google.com with ESMTPS id r29sm65664017wbv.9.2010.04.21.03.32.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Apr 2010 03:32:32 -0700 (PDT) Date: Wed, 21 Apr 2010 12:32:04 +0200 From: Dan Carpenter To: Chris Mason Cc: Al Viro , Joel Becker , James Morris , Christoph Hellwig , linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] btrfs: add check for ERR_PTR() Message-ID: <20100421103204.GD29647@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]); Wed, 21 Apr 2010 10:32:47 +0000 (UTC) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 6ef7b26..c6d84ce 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -60,7 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) size = __btrfs_getxattr(inode, name, value, size); if (size > 0) { acl = posix_acl_from_xattr(value, size); - set_cached_acl(inode, type, acl); + if (!IS_ERR(acl)) + set_cached_acl(inode, type, acl); } kfree(value); } else if (size == -ENOENT || size == -ENODATA || size == 0) {