linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manish Katiyar <mkatiyar@gmail.com>
To: ext4 <linux-ext4@vger.kernel.org>
Cc: Manish Katiyar <manish.katiyar@in.ibm.com>,
	"Theodore Ts'o" <tytso@mit.edu>, Jan Kara <jack@suse.cz>
Subject: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
Date: Sun, 24 Apr 2011 17:18:02 -0700	[thread overview]
Message-ID: <BANLkTin4PDgtZUHgrPnQbg_0+dN6_Fj_Gg@mail.gmail.com> (raw)

This patch fixes the following.

a) Incase journal transaction allocation fails due to ENOMEM don't
call ext4_std_error() since it will
    remount the fs as readonly and logs the message in kernel log.
b) Call posix_acl_release() incase journal allocation fails in case of
error paths.


Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
---
 fs/ext4/acl.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 21eacd7..0c98710 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -354,7 +354,6 @@ ext4_acl_chmod(struct inode *inode)
 				EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
 		if (IS_ERR(handle)) {
 			error = PTR_ERR(handle);
-			ext4_std_error(inode->i_sb, error);
 			goto out;
 		}
 		error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
@@ -450,8 +449,10 @@ ext4_xattr_set_acl(struct dentry *dentry, const
char *name, const void *value,

 retry:
 	handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
-	if (IS_ERR(handle))
-		return PTR_ERR(handle);
+	if (IS_ERR(handle)) {
+		error = PTR_ERR(handle);
+		goto release_and_out;
+	}
 	error = ext4_set_acl(handle, inode, type, acl);
 	ext4_journal_stop(handle);
 	if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
-- 
1.7.1

-- 
Thanks -
Manish

             reply	other threads:[~2011-04-25  0:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-25  0:18 Manish Katiyar [this message]
2011-04-25  0:21 ` [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path Manish Katiyar
2011-05-11 16:18 ` Jan Kara
2011-05-13  2:19   ` Manish Katiyar
2011-05-16 15:44     ` Jan Kara
2011-05-19  4:46       ` Manish Katiyar

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=BANLkTin4PDgtZUHgrPnQbg_0+dN6_Fj_Gg@mail.gmail.com \
    --to=mkatiyar@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=manish.katiyar@in.ibm.com \
    --cc=tytso@mit.edu \
    /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).