All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ext4 : Fix error handling in acl.c if journal start fails
@ 2011-05-25  7:18 Manish Katiyar
  0 siblings, 0 replies; only message in thread
From: Manish Katiyar @ 2011-05-25  7:18 UTC (permalink / raw)
  To: tytso, jack; +Cc: linux-ext4

Hi Ted,

   This patch fixes following issues.

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

-- 
Thanks -
Manish

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-25  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25  7:18 [PATCH 1/3] ext4 : Fix error handling in acl.c if journal start fails Manish Katiyar

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.