From: Manish Katiyar <mkatiyar@gmail.com>
To: tytso@mit.edu, jack@suse.cz, linux-ext4@vger.kernel.org
Cc: Manish Katiyar <mkatiyar@gmail.com>
Subject: [PATCH v2 1/3] ext4: Fix missing acl release in error path in acl.c
Date: Fri, 27 May 2011 23:16:56 -0700 [thread overview]
Message-ID: <1306563416-4286-1-git-send-email-mkatiyar@gmail.com> (raw)
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>
Acked-by: Jan Kara <jack@suse.cz>
---
fs/ext4/acl.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 21eacd7..93dc9a6 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -354,7 +354,8 @@ 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);
+ if (error != -ENOMEM)
+ ext4_std_error(inode->i_sb, error);
goto out;
}
error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
@@ -450,8 +451,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.4.1
next reply other threads:[~2011-05-28 6:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-28 6:16 Manish Katiyar [this message]
2011-05-28 6:20 ` [PATCH v2 2/3] jbd2: Add extra parameter in start_this_handle() to control allocation flags Manish Katiyar
2011-05-31 11:22 ` Jan Kara
2011-05-31 22:27 ` Ted Ts'o
2011-06-02 9:54 ` Jan Kara
2011-06-06 0:12 ` Manish Katiyar
2011-06-06 3:21 ` Ted Ts'o
2011-06-08 14:10 ` Ted Ts'o
2011-06-17 6:32 ` Manish Katiyar
2011-06-20 14:32 ` Jan Kara
2011-06-20 14:40 ` Manish Katiyar
2011-06-20 17:57 ` Ted Ts'o
2011-06-20 18:08 ` Manish Katiyar
2011-05-28 6:21 ` [PATCH v2 3/3] ext4: Fix ext4 to use pass jbd allocation flags if they can handle ENOMEM Manish Katiyar
2011-05-31 12:10 ` Jan Kara
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=1306563416-4286-1-git-send-email-mkatiyar@gmail.com \
--to=mkatiyar@gmail.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.