From: Wang shilong <wangshilong1991@gmail.com>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
Wang shilong <wangshilong1991@gmail.com>,
Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Subject: [PATCH V1 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails
Date: Sun, 13 Jan 2013 18:44:06 +0800 [thread overview]
Message-ID: <1358073846-1662-1-git-send-email-wangshilong1991@gmail.com> (raw)
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
As the only reason that sb_getblk 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/super.c | 2 +-
fs/ext2/xattr.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 663fdcd..3308a55 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1457,7 +1457,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
else
bh = sb_getblk(sb, tmp_bh.b_blocknr);
if (unlikely(!bh)) {
- err = -EIO;
+ err = -ENOMEM;
goto out;
}
lock_buffer(bh);
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.11.7
next reply other threads:[~2013-01-13 10:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-13 10:44 Wang shilong [this message]
2013-01-14 14:25 ` [PATCH V1 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails 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=1358073846-1662-1-git-send-email-wangshilong1991@gmail.com \
--to=wangshilong1991@gmail.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=wangsl-fnst@cn.fujitsu.com \
/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).