浏览代码

ocfs2: Fail ocfs2_get_block() immediately when a block needs allocation

ocfs2_get_block() does no allocation.  Hole filling for writes should
have happened farther up in the call chain.  We detect this case and
print an error, but we then continue with the function.  We should be
exiting immediately.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Wengang Wang 16 年之前
父节点
当前提交
1f4cea3790
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/ocfs2/aops.c

+ 1 - 0
fs/ocfs2/aops.c

@@ -193,6 +193,7 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock,
 			     (unsigned long long)OCFS2_I(inode)->ip_blkno);
 			     (unsigned long long)OCFS2_I(inode)->ip_blkno);
 			mlog(ML_ERROR, "Size %llu, clusters %u\n", (unsigned long long)i_size_read(inode), OCFS2_I(inode)->ip_clusters);
 			mlog(ML_ERROR, "Size %llu, clusters %u\n", (unsigned long long)i_size_read(inode), OCFS2_I(inode)->ip_clusters);
 			dump_stack();
 			dump_stack();
+			goto bail;
 		}
 		}
 
 
 		past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));
 		past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode));