linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Shilong <wangshilong1991@gmail.com>
To: jack@suse.cz
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH V2 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails
Date: Tue, 15 Jan 2013 21:19:06 -0800	[thread overview]
Message-ID: <50F6384A.1070909@gmail.com> (raw)

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

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


             reply	other threads:[~2013-01-15 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16  5:19 Wang Shilong [this message]
2013-01-15 13:30 ` [PATCH V2 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2011-01-16  5:10 Wang Shilong

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=50F6384A.1070909@gmail.com \
    --to=wangshilong1991@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /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).