Patchwork [V2,1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails

login
register
mail settings
Submitter Wang shilong
Date Jan. 16, 2013, 5:19 a.m.
Message ID <50F6384A.1070909@gmail.com>
Download mbox | patch
Permalink /patch/212149/
State Not Applicable
Headers show

Comments

Jan Kara - Jan. 15, 2013, 1:30 p.m.
On Tue 15-01-13 21:19:06, Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> 
> As the only reason that sb_getblks fails is that allocation fails.
> It will be better to use ENOMEM rather than EIO.
  Thanks, I've merged the patch to my tree.

								Honza

> 
> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> ---
>  fs/ext2/xattr.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
> index 06209ec..2d7557d 100644
> --- a/fs/ext2/xattr.c
> +++ b/fs/ext2/xattr.c
> @@ -665,7 +665,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
>  			if (unlikely(!new_bh)) {
>  				ext2_free_blocks(inode, block, 1);
>  				mark_inode_dirty(inode);
> -				error = -EIO;
> +				error = -ENOMEM;
>  				goto cleanup;
>  			}
>  			lock_buffer(new_bh);
> -- 1.7.7.6
>
Wang shilong - Jan. 16, 2013, 5:19 a.m.
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>

As the only reason that sb_getblks fails is that allocation fails.
It will be better to use ENOMEM rather than EIO.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
---
 fs/ext2/xattr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

-- 1.7.7.6

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

Patch

diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 06209ec..2d7557d 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -665,7 +665,7 @@  ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
 			if (unlikely(!new_bh)) {
 				ext2_free_blocks(inode, block, 1);
 				mark_inode_dirty(inode);
-				error = -EIO;
+				error = -ENOMEM;
 				goto cleanup;
 			}
 			lock_buffer(new_bh);