Skip to contentSkip to conversation

Ext2: return ENOMEM rather than EIO if sb_getblk fails

PATCH In review Wang Shilong 1 participant 1 message Jan 15, 2013 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Ext2: return ENOMEM rather than EIO if sb_getblk fails

From: Wang Shilong <[email protected]>

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

---
 fs/ext2/xattr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext2/xattr.c +1 -1
index 06209ec..2d7557d 100644
@@ -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