linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Joel Becker <joel.becker@oracle.com>,
	James Morris <jmorris@namei.org>,
	Chris Mason <chris.mason@oracle.com>,
	kernel-janitors@vger.kernel.org
Subject: [patch 10/11] btrfs: handle ERR_PTR from posix_acl_from_xattr()
Date: Sat, 29 May 2010 11:48:35 +0200	[thread overview]
Message-ID: <20100529094835.GK5483@bicker> (raw)

posix_acl_from_xattr() returns both ERR_PTRs and null, but it's OK to
pass null values to set_cached_acl()

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 8d432cd..e24a19a 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -60,6 +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);
+			if (IS_ERR(acl))
+				return acl;
 			set_cached_acl(inode, type, acl);
 		}
 		kfree(value);

                 reply	other threads:[~2010-05-29  9:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100529094835.GK5483@bicker \
    --to=error27@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=jmorris@namei.org \
    --cc=joel.becker@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).