linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
@ 2011-04-25  0:18 Manish Katiyar
  2011-04-25  0:21 ` Manish Katiyar
  2011-05-11 16:18 ` Jan Kara
  0 siblings, 2 replies; 6+ messages in thread
From: Manish Katiyar @ 2011-04-25  0:18 UTC (permalink / raw)
  To: ext4; +Cc: Manish Katiyar, Theodore Ts'o, Jan Kara

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
  2011-04-25  0:18 [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path Manish Katiyar
@ 2011-04-25  0:21 ` Manish Katiyar
  2011-05-11 16:18 ` Jan Kara
  1 sibling, 0 replies; 6+ messages in thread
From: Manish Katiyar @ 2011-04-25  0:21 UTC (permalink / raw)
  To: ext4; +Cc: Theodore Ts'o, Jan Kara, mkatiyar

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]

On Sun, Apr 24, 2011 at 5:18 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> 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
>



-- 
Thanks -
Manish

[-- Attachment #2: 0004-This-patch-fixes-the-following.-a-Incase-journal-tra.patch --]
[-- Type: text/x-patch, Size: 1460 bytes --]

From 390c5add3d4c0defa4acbebc85fb741b21495f09 Mon Sep 17 00:00:00 2001
From: Manish Katiyar <mkatiyar@gmail.com>
Date: Sun, 24 Apr 2011 01:38:24 -0700
Subject: [PATCH 4/5] 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
  2011-04-25  0:18 [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path Manish Katiyar
  2011-04-25  0:21 ` Manish Katiyar
@ 2011-05-11 16:18 ` Jan Kara
  2011-05-13  2:19   ` Manish Katiyar
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Kara @ 2011-05-11 16:18 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: ext4, Manish Katiyar, Theodore Ts'o, Jan Kara

On Sun 24-04-11 17:18:02, Manish Katiyar wrote:
> 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);
  The changelog speaks only about ENOMEM but you actually remove the
message completely (so it won't catch EIO or similar errors). I think you
should just condition ext4_std_error() with if (error != ENOMEM).

>  			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))

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
  2011-05-11 16:18 ` Jan Kara
@ 2011-05-13  2:19   ` Manish Katiyar
  2011-05-16 15:44     ` Jan Kara
  0 siblings, 1 reply; 6+ messages in thread
From: Manish Katiyar @ 2011-05-13  2:19 UTC (permalink / raw)
  To: Jan Kara; +Cc: ext4, mkatiyar, Theodore Ts'o

On Wed, May 11, 2011 at 9:18 AM, Jan Kara <jack@suse.cz> wrote:
> On Sun 24-04-11 17:18:02, Manish Katiyar wrote:
>> 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);
>  The changelog speaks only about ENOMEM but you actually remove the
> message completely (so it won't catch EIO or similar errors). I think you
> should just condition ext4_std_error() with if (error != ENOMEM).

Hi Jan,

Thanks for your response. Here is the updated patch.

---------------------------------------------------------------------------------------------------------------------
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 |    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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
  2011-05-13  2:19   ` Manish Katiyar
@ 2011-05-16 15:44     ` Jan Kara
  2011-05-19  4:46       ` Manish Katiyar
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kara @ 2011-05-16 15:44 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: Jan Kara, ext4, Theodore Ts'o

On Thu 12-05-11 19:19:29, Manish Katiyar wrote:
> On Wed, May 11, 2011 at 9:18 AM, Jan Kara <jack@suse.cz> wrote:
> > On Sun 24-04-11 17:18:02, Manish Katiyar wrote:
> >> 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);
> >  The changelog speaks only about ENOMEM but you actually remove the
> > message completely (so it won't catch EIO or similar errors). I think you
> > should just condition ext4_std_error() with if (error != ENOMEM).
> 
> Hi Jan,
> 
> Thanks for your response. Here is the updated patch.
> 
> ---------------------------------------------------------------------------------------------------------------------
> 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.
  This patch looks OK now. You can add:
Acked-by: Jan Kara <jack@suse.cz>

									Honza
> Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
> ---
>  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
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path.
  2011-05-16 15:44     ` Jan Kara
@ 2011-05-19  4:46       ` Manish Katiyar
  0 siblings, 0 replies; 6+ messages in thread
From: Manish Katiyar @ 2011-05-19  4:46 UTC (permalink / raw)
  To: Jan Kara; +Cc: ext4, Theodore Ts'o

On Mon, May 16, 2011 at 8:44 AM, Jan Kara <jack@suse.cz> wrote:
> On Thu 12-05-11 19:19:29, Manish Katiyar wrote:
>> On Wed, May 11, 2011 at 9:18 AM, Jan Kara <jack@suse.cz> wrote:
>> > On Sun 24-04-11 17:18:02, Manish Katiyar wrote:
>> >> 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);
>> >  The changelog speaks only about ENOMEM but you actually remove the
>> > message completely (so it won't catch EIO or similar errors). I think you
>> > should just condition ext4_std_error() with if (error != ENOMEM).
>>
>> Hi Jan,
>>
>> Thanks for your response. Here is the updated patch.
>>
>> ---------------------------------------------------------------------------------------------------------------------
>> 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.
>  This patch looks OK now. You can add:
> Acked-by: Jan Kara <jack@suse.cz>

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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-19  4:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-25  0:18 [PATCH 4/5] ext4 : Add missing posix_acl_release() in ext4_xattr_set_acl() in error path Manish Katiyar
2011-04-25  0:21 ` 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

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).