From 8bf2098526901c9991d22d6b8b5ad713b9b6d09d Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Tue, 5 Nov 2013 16:55:01 +1100 Subject: [PATCH] ocfs2-return-enomem-when-sb_getblk-fails-update ocfs2_symlink_get_block in aops.c, and ocfs2_read_blocks_sync and ocfs2_read_blocks in buffer_head_io.c need do the same change for consistency. Cc: Rui Xiang Cc: Jie Liu Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton --- fs/ocfs2/aops.c | 1 + fs/ocfs2/buffer_head_io.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 80963f593539..c20360002f29 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -93,6 +93,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock, iblock; buffer_cache_bh = sb_getblk(osb->sb, blkno); if (!buffer_cache_bh) { + err = -ENOMEM; mlog(ML_ERROR, "couldn't getblock for symlink!\n"); goto bail; } diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index 5d18ad10c27f..5b704c63a103 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -115,7 +115,7 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, if (bhs[i] == NULL) { bhs[i] = sb_getblk(osb->sb, block++); if (bhs[i] == NULL) { - status = -EIO; + status = -ENOMEM; mlog_errno(status); goto bail; } @@ -214,7 +214,7 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, bhs[i] = sb_getblk(sb, block++); if (bhs[i] == NULL) { ocfs2_metadata_cache_io_unlock(ci); - status = -EIO; + status = -ENOMEM; mlog_errno(status); goto bail; } -- 2.39.5