lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1294916018-3456-1-git-send-email-wangshilong1991@gmail.com>
Date:	Thu, 13 Jan 2011 18:53:38 +0800
From:	Wang shilong <wangshilong1991@...il.com>
To:	272316530@...com
Cc:	Wang shilong <wangshilong1991@...il.com>,
	Wang Shilong <wangsl-fnst@...fujitsu.com>
Subject: [PATCH 1/2] Ext2: return ENOMEM rather than EIO if sb_getblk fails

From: Wang Shilong <wangsl-fnst@...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@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ