Commit 7ecef14a authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

ocfs2: neaten do_error, ocfs2_error and ocfs2_abort

These uses sometimes do and sometimes don't have '\n' terminations.  Make
the uses consistently use '\n' terminations and remove the newline from
the functions.

Miscellanea:

o Coalesce formats
o Realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d0c97d52
...@@ -909,27 +909,25 @@ static int ocfs2_validate_extent_block(struct super_block *sb, ...@@ -909,27 +909,25 @@ static int ocfs2_validate_extent_block(struct super_block *sb,
if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Extent block #%llu has bad signature %.*s", "Extent block #%llu has bad signature %.*s\n",
(unsigned long long)bh->b_blocknr, 7, (unsigned long long)bh->b_blocknr, 7,
eb->h_signature); eb->h_signature);
goto bail; goto bail;
} }
if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Extent block #%llu has an invalid h_blkno " "Extent block #%llu has an invalid h_blkno of %llu\n",
"of %llu", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, (unsigned long long)le64_to_cpu(eb->h_blkno));
(unsigned long long)le64_to_cpu(eb->h_blkno));
goto bail; goto bail;
} }
if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) { if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Extent block #%llu has an invalid " "Extent block #%llu has an invalid h_fs_generation of #%u\n",
"h_fs_generation of #%u", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, le32_to_cpu(eb->h_fs_generation));
le32_to_cpu(eb->h_fs_generation));
goto bail; goto bail;
} }
bail: bail:
...@@ -1446,8 +1444,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et, ...@@ -1446,8 +1444,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
while(le16_to_cpu(el->l_tree_depth) > 1) { while(le16_to_cpu(el->l_tree_depth) > 1) {
if (le16_to_cpu(el->l_next_free_rec) == 0) { if (le16_to_cpu(el->l_next_free_rec) == 0) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has empty " "Owner %llu has empty extent list (next_free_rec == 0)\n",
"extent list (next_free_rec == 0)",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
status = -EIO; status = -EIO;
goto bail; goto bail;
...@@ -1456,9 +1453,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et, ...@@ -1456,9 +1453,7 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
blkno = le64_to_cpu(el->l_recs[i].e_blkno); blkno = le64_to_cpu(el->l_recs[i].e_blkno);
if (!blkno) { if (!blkno) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has extent " "Owner %llu has extent list where extent # %d has no physical block start\n",
"list where extent # %d has no physical "
"block start",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), i); (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), i);
status = -EIO; status = -EIO;
goto bail; goto bail;
...@@ -1788,8 +1783,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci, ...@@ -1788,8 +1783,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
while (el->l_tree_depth) { while (el->l_tree_depth) {
if (le16_to_cpu(el->l_next_free_rec) == 0) { if (le16_to_cpu(el->l_next_free_rec) == 0) {
ocfs2_error(ocfs2_metadata_cache_get_super(ci), ocfs2_error(ocfs2_metadata_cache_get_super(ci),
"Owner %llu has empty extent list at " "Owner %llu has empty extent list at depth %u\n",
"depth %u\n",
(unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)ocfs2_metadata_cache_owner(ci),
le16_to_cpu(el->l_tree_depth)); le16_to_cpu(el->l_tree_depth));
ret = -EROFS; ret = -EROFS;
...@@ -1814,8 +1808,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci, ...@@ -1814,8 +1808,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
blkno = le64_to_cpu(el->l_recs[i].e_blkno); blkno = le64_to_cpu(el->l_recs[i].e_blkno);
if (blkno == 0) { if (blkno == 0) {
ocfs2_error(ocfs2_metadata_cache_get_super(ci), ocfs2_error(ocfs2_metadata_cache_get_super(ci),
"Owner %llu has bad blkno in extent list " "Owner %llu has bad blkno in extent list at depth %u (index %d)\n",
"at depth %u (index %d)\n",
(unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)ocfs2_metadata_cache_owner(ci),
le16_to_cpu(el->l_tree_depth), i); le16_to_cpu(el->l_tree_depth), i);
ret = -EROFS; ret = -EROFS;
...@@ -1836,8 +1829,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci, ...@@ -1836,8 +1829,7 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci,
if (le16_to_cpu(el->l_next_free_rec) > if (le16_to_cpu(el->l_next_free_rec) >
le16_to_cpu(el->l_count)) { le16_to_cpu(el->l_count)) {
ocfs2_error(ocfs2_metadata_cache_get_super(ci), ocfs2_error(ocfs2_metadata_cache_get_super(ci),
"Owner %llu has bad count in extent list " "Owner %llu has bad count in extent list at block %llu (next free=%u, count=%u)\n",
"at block %llu (next free=%u, count=%u)\n",
(unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)ocfs2_metadata_cache_owner(ci),
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le16_to_cpu(el->l_next_free_rec), le16_to_cpu(el->l_next_free_rec),
...@@ -2116,8 +2108,7 @@ static int ocfs2_rotate_subtree_right(handle_t *handle, ...@@ -2116,8 +2108,7 @@ static int ocfs2_rotate_subtree_right(handle_t *handle,
if (left_el->l_next_free_rec != left_el->l_count) { if (left_el->l_next_free_rec != left_el->l_count) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Inode %llu has non-full interior leaf node %llu" "Inode %llu has non-full interior leaf node %llu (next free = %u)\n",
"(next free = %u)",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
(unsigned long long)left_leaf_bh->b_blocknr, (unsigned long long)left_leaf_bh->b_blocknr,
le16_to_cpu(left_el->l_next_free_rec)); le16_to_cpu(left_el->l_next_free_rec));
...@@ -2256,8 +2247,7 @@ int ocfs2_find_cpos_for_left_leaf(struct super_block *sb, ...@@ -2256,8 +2247,7 @@ int ocfs2_find_cpos_for_left_leaf(struct super_block *sb,
* If we got here, we never found a valid node where * If we got here, we never found a valid node where
* the tree indicated one should be. * the tree indicated one should be.
*/ */
ocfs2_error(sb, ocfs2_error(sb, "Invalid extent tree at extent block %llu\n",
"Invalid extent tree at extent block %llu\n",
(unsigned long long)blkno); (unsigned long long)blkno);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -2872,8 +2862,7 @@ int ocfs2_find_cpos_for_right_leaf(struct super_block *sb, ...@@ -2872,8 +2862,7 @@ int ocfs2_find_cpos_for_right_leaf(struct super_block *sb,
* If we got here, we never found a valid node where * If we got here, we never found a valid node where
* the tree indicated one should be. * the tree indicated one should be.
*/ */
ocfs2_error(sb, ocfs2_error(sb, "Invalid extent tree at extent block %llu\n",
"Invalid extent tree at extent block %llu\n",
(unsigned long long)blkno); (unsigned long long)blkno);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -3224,7 +3213,7 @@ static int ocfs2_rotate_tree_left(handle_t *handle, ...@@ -3224,7 +3213,7 @@ static int ocfs2_rotate_tree_left(handle_t *handle,
if (le16_to_cpu(el->l_next_free_rec) == 0) { if (le16_to_cpu(el->l_next_free_rec) == 0) {
ret = -EIO; ret = -EIO;
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has empty extent block at %llu", "Owner %llu has empty extent block at %llu\n",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
(unsigned long long)le64_to_cpu(eb->h_blkno)); (unsigned long long)le64_to_cpu(eb->h_blkno));
goto out; goto out;
...@@ -3954,7 +3943,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle, ...@@ -3954,7 +3943,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
next_free = le16_to_cpu(el->l_next_free_rec); next_free = le16_to_cpu(el->l_next_free_rec);
if (next_free == 0) { if (next_free == 0) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has a bad extent list", "Owner %llu has a bad extent list\n",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
ret = -EIO; ret = -EIO;
return; return;
...@@ -4379,10 +4368,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et, ...@@ -4379,10 +4368,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
bh = path_leaf_bh(left_path); bh = path_leaf_bh(left_path);
eb = (struct ocfs2_extent_block *)bh->b_data; eb = (struct ocfs2_extent_block *)bh->b_data;
ocfs2_error(sb, ocfs2_error(sb,
"Extent block #%llu has an " "Extent block #%llu has an invalid l_next_free_rec of %d. It should have matched the l_count of %d\n",
"invalid l_next_free_rec of "
"%d. It should have "
"matched the l_count of %d",
(unsigned long long)le64_to_cpu(eb->h_blkno), (unsigned long long)le64_to_cpu(eb->h_blkno),
le16_to_cpu(new_el->l_next_free_rec), le16_to_cpu(new_el->l_next_free_rec),
le16_to_cpu(new_el->l_count)); le16_to_cpu(new_el->l_count));
...@@ -4437,8 +4423,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et, ...@@ -4437,8 +4423,7 @@ static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et,
bh = path_leaf_bh(right_path); bh = path_leaf_bh(right_path);
eb = (struct ocfs2_extent_block *)bh->b_data; eb = (struct ocfs2_extent_block *)bh->b_data;
ocfs2_error(sb, ocfs2_error(sb,
"Extent block #%llu has an " "Extent block #%llu has an invalid l_next_free_rec of %d\n",
"invalid l_next_free_rec of %d",
(unsigned long long)le64_to_cpu(eb->h_blkno), (unsigned long long)le64_to_cpu(eb->h_blkno),
le16_to_cpu(new_el->l_next_free_rec)); le16_to_cpu(new_el->l_next_free_rec));
status = -EINVAL; status = -EINVAL;
...@@ -4994,10 +4979,9 @@ static int ocfs2_split_and_insert(handle_t *handle, ...@@ -4994,10 +4979,9 @@ static int ocfs2_split_and_insert(handle_t *handle,
split_index = ocfs2_search_extent_list(el, cpos); split_index = ocfs2_search_extent_list(el, cpos);
if (split_index == -1) { if (split_index == -1) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has an extent at cpos %u " "Owner %llu has an extent at cpos %u which can no longer be found\n",
"which can no longer be found.\n", (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), cpos);
cpos);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
} }
...@@ -5182,10 +5166,9 @@ int ocfs2_change_extent_flag(handle_t *handle, ...@@ -5182,10 +5166,9 @@ int ocfs2_change_extent_flag(handle_t *handle,
index = ocfs2_search_extent_list(el, cpos); index = ocfs2_search_extent_list(el, cpos);
if (index == -1) { if (index == -1) {
ocfs2_error(sb, ocfs2_error(sb,
"Owner %llu has an extent at cpos %u which can no " "Owner %llu has an extent at cpos %u which can no longer be found\n",
"longer be found.\n", (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
(unsigned long long) cpos);
ocfs2_metadata_cache_owner(et->et_ci), cpos);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
} }
...@@ -5252,9 +5235,7 @@ int ocfs2_mark_extent_written(struct inode *inode, ...@@ -5252,9 +5235,7 @@ int ocfs2_mark_extent_written(struct inode *inode,
cpos, len, phys); cpos, len, phys);
if (!ocfs2_writes_unwritten_extents(OCFS2_SB(inode->i_sb))) { if (!ocfs2_writes_unwritten_extents(OCFS2_SB(inode->i_sb))) {
ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents " ocfs2_error(inode->i_sb, "Inode %llu has unwritten extents that are being written to, but the feature bit is not set in the super block\n",
"that are being written to, but the feature bit "
"is not set in the super block.",
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -5538,8 +5519,7 @@ int ocfs2_remove_extent(handle_t *handle, ...@@ -5538,8 +5519,7 @@ int ocfs2_remove_extent(handle_t *handle,
index = ocfs2_search_extent_list(el, cpos); index = ocfs2_search_extent_list(el, cpos);
if (index == -1) { if (index == -1) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has an extent at cpos %u which can no " "Owner %llu has an extent at cpos %u which can no longer be found\n",
"longer be found.\n",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
cpos); cpos);
ret = -EROFS; ret = -EROFS;
...@@ -5604,7 +5584,7 @@ int ocfs2_remove_extent(handle_t *handle, ...@@ -5604,7 +5584,7 @@ int ocfs2_remove_extent(handle_t *handle,
index = ocfs2_search_extent_list(el, cpos); index = ocfs2_search_extent_list(el, cpos);
if (index == -1) { if (index == -1) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu: split at cpos %u lost record.", "Owner %llu: split at cpos %u lost record\n",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
cpos); cpos);
ret = -EROFS; ret = -EROFS;
...@@ -5620,8 +5600,7 @@ int ocfs2_remove_extent(handle_t *handle, ...@@ -5620,8 +5600,7 @@ int ocfs2_remove_extent(handle_t *handle,
ocfs2_rec_clusters(el, rec); ocfs2_rec_clusters(el, rec);
if (rec_range != trunc_range) { if (rec_range != trunc_range) {
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu: error after split at cpos %u" "Owner %llu: error after split at cpos %u trunc len %u, existing record is (%u,%u)\n",
"trunc len %u, existing record is (%u,%u)",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci),
cpos, len, le32_to_cpu(rec->e_cpos), cpos, len, le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec)); ocfs2_rec_clusters(el, rec));
...@@ -7236,8 +7215,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, ...@@ -7236,8 +7215,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) || !(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) ||
!ocfs2_supports_inline_data(osb)) { !ocfs2_supports_inline_data(osb)) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Inline data flags for inode %llu don't agree! " "Inline data flags for inode %llu don't agree! Disk: 0x%x, Memory: 0x%x, Superblock: 0x%x\n",
"Disk: 0x%x, Memory: 0x%x, Superblock: 0x%x\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno, (unsigned long long)OCFS2_I(inode)->ip_blkno,
le16_to_cpu(di->i_dyn_features), le16_to_cpu(di->i_dyn_features),
OCFS2_I(inode)->ip_dyn_features, OCFS2_I(inode)->ip_dyn_features,
......
...@@ -227,7 +227,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page, ...@@ -227,7 +227,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
if (!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL)) { if (!(le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL)) {
ocfs2_error(inode->i_sb, "Inode %llu lost inline data flag", ocfs2_error(inode->i_sb, "Inode %llu lost inline data flag\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
return -EROFS; return -EROFS;
} }
...@@ -237,7 +237,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page, ...@@ -237,7 +237,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page,
if (size > PAGE_CACHE_SIZE || if (size > PAGE_CACHE_SIZE ||
size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) { size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Inode %llu has with inline data has bad size: %Lu", "Inode %llu has with inline data has bad size: %Lu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno, (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)size); (unsigned long long)size);
return -EROFS; return -EROFS;
......
...@@ -481,29 +481,25 @@ static int ocfs2_check_dir_trailer(struct inode *dir, struct buffer_head *bh) ...@@ -481,29 +481,25 @@ static int ocfs2_check_dir_trailer(struct inode *dir, struct buffer_head *bh)
trailer = ocfs2_trailer_from_bh(bh, dir->i_sb); trailer = ocfs2_trailer_from_bh(bh, dir->i_sb);
if (!OCFS2_IS_VALID_DIR_TRAILER(trailer)) { if (!OCFS2_IS_VALID_DIR_TRAILER(trailer)) {
rc = ocfs2_error(dir->i_sb, rc = ocfs2_error(dir->i_sb,
"Invalid dirblock #%llu: " "Invalid dirblock #%llu: signature = %.*s\n",
"signature = %.*s\n", (unsigned long long)bh->b_blocknr, 7,
(unsigned long long)bh->b_blocknr, 7, trailer->db_signature);
trailer->db_signature);
goto out; goto out;
} }
if (le64_to_cpu(trailer->db_blkno) != bh->b_blocknr) { if (le64_to_cpu(trailer->db_blkno) != bh->b_blocknr) {
rc = ocfs2_error(dir->i_sb, rc = ocfs2_error(dir->i_sb,
"Directory block #%llu has an invalid " "Directory block #%llu has an invalid db_blkno of %llu\n",
"db_blkno of %llu", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, (unsigned long long)le64_to_cpu(trailer->db_blkno));
(unsigned long long)le64_to_cpu(trailer->db_blkno));
goto out; goto out;
} }
if (le64_to_cpu(trailer->db_parent_dinode) != if (le64_to_cpu(trailer->db_parent_dinode) !=
OCFS2_I(dir)->ip_blkno) { OCFS2_I(dir)->ip_blkno) {
rc = ocfs2_error(dir->i_sb, rc = ocfs2_error(dir->i_sb,
"Directory block #%llu on dinode " "Directory block #%llu on dinode #%llu has an invalid parent_dinode of %llu\n",
"#%llu has an invalid parent_dinode " (unsigned long long)bh->b_blocknr,
"of %llu", (unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)bh->b_blocknr, (unsigned long long)le64_to_cpu(trailer->db_blkno));
(unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)le64_to_cpu(trailer->db_blkno));
goto out; goto out;
} }
out: out:
...@@ -602,9 +598,9 @@ static int ocfs2_validate_dx_root(struct super_block *sb, ...@@ -602,9 +598,9 @@ static int ocfs2_validate_dx_root(struct super_block *sb,
if (!OCFS2_IS_VALID_DX_ROOT(dx_root)) { if (!OCFS2_IS_VALID_DX_ROOT(dx_root)) {
ret = ocfs2_error(sb, ret = ocfs2_error(sb,
"Dir Index Root # %llu has bad signature %.*s", "Dir Index Root # %llu has bad signature %.*s\n",
(unsigned long long)le64_to_cpu(dx_root->dr_blkno), (unsigned long long)le64_to_cpu(dx_root->dr_blkno),
7, dx_root->dr_signature); 7, dx_root->dr_signature);
} }
return ret; return ret;
...@@ -644,8 +640,8 @@ static int ocfs2_validate_dx_leaf(struct super_block *sb, ...@@ -644,8 +640,8 @@ static int ocfs2_validate_dx_leaf(struct super_block *sb,
} }
if (!OCFS2_IS_VALID_DX_LEAF(dx_leaf)) { if (!OCFS2_IS_VALID_DX_LEAF(dx_leaf)) {
ret = ocfs2_error(sb, "Dir Index Leaf has bad signature %.*s", ret = ocfs2_error(sb, "Dir Index Leaf has bad signature %.*s\n",
7, dx_leaf->dl_signature); 7, dx_leaf->dl_signature);
} }
return ret; return ret;
...@@ -808,9 +804,9 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode, ...@@ -808,9 +804,9 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ret = ocfs2_error(inode->i_sb, ret = ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in btree tree block %llu\n",
"btree tree block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
goto out; goto out;
} }
} }
...@@ -826,10 +822,11 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode, ...@@ -826,10 +822,11 @@ static int ocfs2_dx_dir_lookup_rec(struct inode *inode,
} }
if (!found) { if (!found) {
ret = ocfs2_error(inode->i_sb, "Inode %lu has bad extent " ret = ocfs2_error(inode->i_sb,
"record (%u, %u, 0) in btree", inode->i_ino, "Inode %lu has bad extent record (%u, %u, 0) in btree\n",
le32_to_cpu(rec->e_cpos), inode->i_ino,
ocfs2_rec_clusters(el, rec)); le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec));
goto out; goto out;
} }
......
...@@ -305,8 +305,8 @@ static int ocfs2_last_eb_is_empty(struct inode *inode, ...@@ -305,8 +305,8 @@ static int ocfs2_last_eb_is_empty(struct inode *inode,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in leaf block %llu\n",
"leaf block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -441,8 +441,8 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, ...@@ -441,8 +441,8 @@ static int ocfs2_get_clusters_nocache(struct inode *inode,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in leaf block %llu\n",
"leaf block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -475,8 +475,9 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, ...@@ -475,8 +475,9 @@ static int ocfs2_get_clusters_nocache(struct inode *inode,
BUG_ON(v_cluster < le32_to_cpu(rec->e_cpos)); BUG_ON(v_cluster < le32_to_cpu(rec->e_cpos));
if (!rec->e_blkno) { if (!rec->e_blkno) {
ocfs2_error(inode->i_sb, "Inode %lu has bad extent " ocfs2_error(inode->i_sb,
"record (%u, %u, 0)", inode->i_ino, "Inode %lu has bad extent record (%u, %u, 0)\n",
inode->i_ino,
le32_to_cpu(rec->e_cpos), le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec)); ocfs2_rec_clusters(el, rec));
ret = -EROFS; ret = -EROFS;
...@@ -564,8 +565,8 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, ...@@ -564,8 +565,8 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in xattr leaf block %llu\n",
"xattr leaf block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
ret = -EROFS; ret = -EROFS;
goto out; goto out;
...@@ -582,8 +583,9 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster, ...@@ -582,8 +583,9 @@ int ocfs2_xattr_get_clusters(struct inode *inode, u32 v_cluster,
BUG_ON(v_cluster < le32_to_cpu(rec->e_cpos)); BUG_ON(v_cluster < le32_to_cpu(rec->e_cpos));
if (!rec->e_blkno) { if (!rec->e_blkno) {
ocfs2_error(inode->i_sb, "Inode %lu has bad extent " ocfs2_error(inode->i_sb,
"record (%u, %u, 0) in xattr", inode->i_ino, "Inode %lu has bad extent record (%u, %u, 0) in xattr\n",
inode->i_ino,
le32_to_cpu(rec->e_cpos), le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec)); ocfs2_rec_clusters(el, rec));
ret = -EROFS; ret = -EROFS;
......
...@@ -1362,31 +1362,31 @@ int ocfs2_validate_inode_block(struct super_block *sb, ...@@ -1362,31 +1362,31 @@ int ocfs2_validate_inode_block(struct super_block *sb,
if (!OCFS2_IS_VALID_DINODE(di)) { if (!OCFS2_IS_VALID_DINODE(di)) {
rc = ocfs2_error(sb, "Invalid dinode #%llu: signature = %.*s\n", rc = ocfs2_error(sb, "Invalid dinode #%llu: signature = %.*s\n",
(unsigned long long)bh->b_blocknr, 7, (unsigned long long)bh->b_blocknr, 7,
di->i_signature); di->i_signature);
goto bail; goto bail;
} }
if (le64_to_cpu(di->i_blkno) != bh->b_blocknr) { if (le64_to_cpu(di->i_blkno) != bh->b_blocknr) {
rc = ocfs2_error(sb, "Invalid dinode #%llu: i_blkno is %llu\n", rc = ocfs2_error(sb, "Invalid dinode #%llu: i_blkno is %llu\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
(unsigned long long)le64_to_cpu(di->i_blkno)); (unsigned long long)le64_to_cpu(di->i_blkno));
goto bail; goto bail;
} }
if (!(di->i_flags & cpu_to_le32(OCFS2_VALID_FL))) { if (!(di->i_flags & cpu_to_le32(OCFS2_VALID_FL))) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Invalid dinode #%llu: OCFS2_VALID_FL not set\n", "Invalid dinode #%llu: OCFS2_VALID_FL not set\n",
(unsigned long long)bh->b_blocknr); (unsigned long long)bh->b_blocknr);
goto bail; goto bail;
} }
if (le32_to_cpu(di->i_fs_generation) != if (le32_to_cpu(di->i_fs_generation) !=
OCFS2_SB(sb)->fs_generation) { OCFS2_SB(sb)->fs_generation) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Invalid dinode #%llu: fs_generation is %u\n", "Invalid dinode #%llu: fs_generation is %u\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le32_to_cpu(di->i_fs_generation)); le32_to_cpu(di->i_fs_generation));
goto bail; goto bail;
} }
......
...@@ -374,7 +374,7 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs) ...@@ -374,7 +374,7 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *osb, int max_buffs)
mlog_errno(PTR_ERR(handle)); mlog_errno(PTR_ERR(handle));
if (is_journal_aborted(journal)) { if (is_journal_aborted(journal)) {
ocfs2_abort(osb->sb, "Detected aborted journal"); ocfs2_abort(osb->sb, "Detected aborted journal\n");
handle = ERR_PTR(-EROFS); handle = ERR_PTR(-EROFS);
} }
} else { } else {
......
...@@ -665,8 +665,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, ...@@ -665,8 +665,7 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
#ifdef CONFIG_OCFS2_DEBUG_FS #ifdef CONFIG_OCFS2_DEBUG_FS
if (le32_to_cpu(alloc->id1.bitmap1.i_used) != if (le32_to_cpu(alloc->id1.bitmap1.i_used) !=
ocfs2_local_alloc_count_bits(alloc)) { ocfs2_local_alloc_count_bits(alloc)) {
ocfs2_error(osb->sb, "local alloc inode %llu says it has " ocfs2_error(osb->sb, "local alloc inode %llu says it has %u used bits, but a count shows %u\n",
"%u used bits, but a count shows %u",
(unsigned long long)le64_to_cpu(alloc->i_blkno), (unsigned long long)le64_to_cpu(alloc->i_blkno),
le32_to_cpu(alloc->id1.bitmap1.i_used), le32_to_cpu(alloc->id1.bitmap1.i_used),
ocfs2_local_alloc_count_bits(alloc)); ocfs2_local_alloc_count_bits(alloc));
......
...@@ -100,9 +100,8 @@ static int __ocfs2_move_extent(handle_t *handle, ...@@ -100,9 +100,8 @@ static int __ocfs2_move_extent(handle_t *handle,
index = ocfs2_search_extent_list(el, cpos); index = ocfs2_search_extent_list(el, cpos);
if (index == -1) { if (index == -1) {
ret = ocfs2_error(inode->i_sb, ret = ocfs2_error(inode->i_sb,
"Inode %llu has an extent at cpos %u which can no " "Inode %llu has an extent at cpos %u which can no longer be found\n",
"longer be found.\n", (unsigned long long)ino, cpos);
(unsigned long long)ino, cpos);
goto out; goto out;
} }
......
...@@ -138,8 +138,7 @@ static int ocfs2_read_quota_block(struct inode *inode, u64 v_block, ...@@ -138,8 +138,7 @@ static int ocfs2_read_quota_block(struct inode *inode, u64 v_block,
if (i_size_read(inode) >> inode->i_sb->s_blocksize_bits <= v_block) { if (i_size_read(inode) >> inode->i_sb->s_blocksize_bits <= v_block) {
ocfs2_error(inode->i_sb, ocfs2_error(inode->i_sb,
"Quota file %llu is probably corrupted! Requested " "Quota file %llu is probably corrupted! Requested to read block %Lu but file has size only %Lu\n",
"to read block %Lu but file has size only %Lu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno, (unsigned long long)OCFS2_I(inode)->ip_blkno,
(unsigned long long)v_block, (unsigned long long)v_block,
(unsigned long long)i_size_read(inode)); (unsigned long long)i_size_read(inode));
......
...@@ -103,27 +103,25 @@ static int ocfs2_validate_refcount_block(struct super_block *sb, ...@@ -103,27 +103,25 @@ static int ocfs2_validate_refcount_block(struct super_block *sb,
if (!OCFS2_IS_VALID_REFCOUNT_BLOCK(rb)) { if (!OCFS2_IS_VALID_REFCOUNT_BLOCK(rb)) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Refcount block #%llu has bad signature %.*s", "Refcount block #%llu has bad signature %.*s\n",
(unsigned long long)bh->b_blocknr, 7, (unsigned long long)bh->b_blocknr, 7,
rb->rf_signature); rb->rf_signature);
goto out; goto out;
} }
if (le64_to_cpu(rb->rf_blkno) != bh->b_blocknr) { if (le64_to_cpu(rb->rf_blkno) != bh->b_blocknr) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Refcount block #%llu has an invalid rf_blkno " "Refcount block #%llu has an invalid rf_blkno of %llu\n",
"of %llu", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, (unsigned long long)le64_to_cpu(rb->rf_blkno));
(unsigned long long)le64_to_cpu(rb->rf_blkno));
goto out; goto out;
} }
if (le32_to_cpu(rb->rf_fs_generation) != OCFS2_SB(sb)->fs_generation) { if (le32_to_cpu(rb->rf_fs_generation) != OCFS2_SB(sb)->fs_generation) {
rc = ocfs2_error(sb, rc = ocfs2_error(sb,
"Refcount block #%llu has an invalid " "Refcount block #%llu has an invalid rf_fs_generation of #%u\n",
"rf_fs_generation of #%u", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, le32_to_cpu(rb->rf_fs_generation));
le32_to_cpu(rb->rf_fs_generation));
goto out; goto out;
} }
out: out:
...@@ -1103,10 +1101,9 @@ static int ocfs2_get_refcount_rec(struct ocfs2_caching_info *ci, ...@@ -1103,10 +1101,9 @@ static int ocfs2_get_refcount_rec(struct ocfs2_caching_info *ci,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ret = ocfs2_error(sb, ret = ocfs2_error(sb,
"refcount tree %llu has non zero tree " "refcount tree %llu has non zero tree depth in leaf btree tree block %llu\n",
"depth in leaf btree tree block %llu\n", (unsigned long long)ocfs2_metadata_cache_owner(ci),
(unsigned long long)ocfs2_metadata_cache_owner(ci), (unsigned long long)eb_bh->b_blocknr);
(unsigned long long)eb_bh->b_blocknr);
goto out; goto out;
} }
} }
...@@ -2358,9 +2355,8 @@ static int ocfs2_mark_extent_refcounted(struct inode *inode, ...@@ -2358,9 +2355,8 @@ static int ocfs2_mark_extent_refcounted(struct inode *inode,
cpos, len, phys); cpos, len, phys);
if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) { if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) {
ret = ocfs2_error(inode->i_sb, "Inode %lu want to use refcount " ret = ocfs2_error(inode->i_sb, "Inode %lu want to use refcount tree, but the feature bit is not set in the super block\n",
"tree, but the feature bit is not set in the " inode->i_ino);
"super block.", inode->i_ino);
goto out; goto out;
} }
...@@ -2543,9 +2539,8 @@ int ocfs2_prepare_refcount_change_for_del(struct inode *inode, ...@@ -2543,9 +2539,8 @@ int ocfs2_prepare_refcount_change_for_del(struct inode *inode,
u64 start_cpos = ocfs2_blocks_to_clusters(inode->i_sb, phys_blkno); u64 start_cpos = ocfs2_blocks_to_clusters(inode->i_sb, phys_blkno);
if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) { if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) {
ret = ocfs2_error(inode->i_sb, "Inode %lu want to use refcount " ret = ocfs2_error(inode->i_sb, "Inode %lu want to use refcount tree, but the feature bit is not set in the super block\n",
"tree, but the feature bit is not set in the " inode->i_ino);
"super block.", inode->i_ino);
goto out; goto out;
} }
...@@ -2670,9 +2665,9 @@ static int ocfs2_refcount_cal_cow_clusters(struct inode *inode, ...@@ -2670,9 +2665,9 @@ static int ocfs2_refcount_cal_cow_clusters(struct inode *inode,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ret = ocfs2_error(inode->i_sb, ret = ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in leaf block %llu\n",
"leaf block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
goto out; goto out;
} }
} }
...@@ -3103,9 +3098,8 @@ static int ocfs2_clear_ext_refcount(handle_t *handle, ...@@ -3103,9 +3098,8 @@ static int ocfs2_clear_ext_refcount(handle_t *handle,
index = ocfs2_search_extent_list(el, cpos); index = ocfs2_search_extent_list(el, cpos);
if (index == -1) { if (index == -1) {
ret = ocfs2_error(sb, ret = ocfs2_error(sb,
"Inode %llu has an extent at cpos %u which can no " "Inode %llu has an extent at cpos %u which can no longer be found\n",
"longer be found.\n", (unsigned long long)ino, cpos);
(unsigned long long)ino, cpos);
goto out; goto out;
} }
...@@ -3371,9 +3365,8 @@ static int ocfs2_replace_cow(struct ocfs2_cow_context *context) ...@@ -3371,9 +3365,8 @@ static int ocfs2_replace_cow(struct ocfs2_cow_context *context)
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) { if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb))) {
return ocfs2_error(inode->i_sb, "Inode %lu want to use refcount " return ocfs2_error(inode->i_sb, "Inode %lu want to use refcount tree, but the feature bit is not set in the super block\n",
"tree, but the feature bit is not set in the " inode->i_ino);
"super block.", inode->i_ino);
} }
ocfs2_init_dealloc_ctxt(&context->dealloc); ocfs2_init_dealloc_ctxt(&context->dealloc);
......
...@@ -167,12 +167,12 @@ static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl) ...@@ -167,12 +167,12 @@ static u32 ocfs2_bits_per_group(struct ocfs2_chain_list *cl)
} }
#define do_error(fmt, ...) \ #define do_error(fmt, ...) \
do{ \ do { \
if (resize) \ if (resize) \
mlog(ML_ERROR, fmt "\n", ##__VA_ARGS__); \ mlog(ML_ERROR, fmt, ##__VA_ARGS__); \
else \ else \
return ocfs2_error(sb, fmt, ##__VA_ARGS__); \ return ocfs2_error(sb, fmt, ##__VA_ARGS__); \
} while (0) } while (0)
static int ocfs2_validate_gd_self(struct super_block *sb, static int ocfs2_validate_gd_self(struct super_block *sb,
struct buffer_head *bh, struct buffer_head *bh,
...@@ -181,36 +181,32 @@ static int ocfs2_validate_gd_self(struct super_block *sb, ...@@ -181,36 +181,32 @@ static int ocfs2_validate_gd_self(struct super_block *sb,
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
if (!OCFS2_IS_VALID_GROUP_DESC(gd)) { if (!OCFS2_IS_VALID_GROUP_DESC(gd)) {
do_error("Group descriptor #%llu has bad signature %.*s", do_error("Group descriptor #%llu has bad signature %.*s\n",
(unsigned long long)bh->b_blocknr, 7, (unsigned long long)bh->b_blocknr, 7,
gd->bg_signature); gd->bg_signature);
} }
if (le64_to_cpu(gd->bg_blkno) != bh->b_blocknr) { if (le64_to_cpu(gd->bg_blkno) != bh->b_blocknr) {
do_error("Group descriptor #%llu has an invalid bg_blkno " do_error("Group descriptor #%llu has an invalid bg_blkno of %llu\n",
"of %llu",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
(unsigned long long)le64_to_cpu(gd->bg_blkno)); (unsigned long long)le64_to_cpu(gd->bg_blkno));
} }
if (le32_to_cpu(gd->bg_generation) != OCFS2_SB(sb)->fs_generation) { if (le32_to_cpu(gd->bg_generation) != OCFS2_SB(sb)->fs_generation) {
do_error("Group descriptor #%llu has an invalid " do_error("Group descriptor #%llu has an invalid fs_generation of #%u\n",
"fs_generation of #%u",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le32_to_cpu(gd->bg_generation)); le32_to_cpu(gd->bg_generation));
} }
if (le16_to_cpu(gd->bg_free_bits_count) > le16_to_cpu(gd->bg_bits)) { if (le16_to_cpu(gd->bg_free_bits_count) > le16_to_cpu(gd->bg_bits)) {
do_error("Group descriptor #%llu has bit count %u but " do_error("Group descriptor #%llu has bit count %u but claims that %u are free\n",
"claims that %u are free",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le16_to_cpu(gd->bg_bits), le16_to_cpu(gd->bg_bits),
le16_to_cpu(gd->bg_free_bits_count)); le16_to_cpu(gd->bg_free_bits_count));
} }
if (le16_to_cpu(gd->bg_bits) > (8 * le16_to_cpu(gd->bg_size))) { if (le16_to_cpu(gd->bg_bits) > (8 * le16_to_cpu(gd->bg_size))) {
do_error("Group descriptor #%llu has bit count %u but " do_error("Group descriptor #%llu has bit count %u but max bitmap bits of %u\n",
"max bitmap bits of %u",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le16_to_cpu(gd->bg_bits), le16_to_cpu(gd->bg_bits),
8 * le16_to_cpu(gd->bg_size)); 8 * le16_to_cpu(gd->bg_size));
...@@ -228,8 +224,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, ...@@ -228,8 +224,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb,
struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data; struct ocfs2_group_desc *gd = (struct ocfs2_group_desc *)bh->b_data;
if (di->i_blkno != gd->bg_parent_dinode) { if (di->i_blkno != gd->bg_parent_dinode) {
do_error("Group descriptor #%llu has bad parent " do_error("Group descriptor #%llu has bad parent pointer (%llu, expected %llu)\n",
"pointer (%llu, expected %llu)",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
(unsigned long long)le64_to_cpu(gd->bg_parent_dinode), (unsigned long long)le64_to_cpu(gd->bg_parent_dinode),
(unsigned long long)le64_to_cpu(di->i_blkno)); (unsigned long long)le64_to_cpu(di->i_blkno));
...@@ -237,7 +232,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, ...@@ -237,7 +232,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb,
max_bits = le16_to_cpu(di->id2.i_chain.cl_cpg) * le16_to_cpu(di->id2.i_chain.cl_bpc); max_bits = le16_to_cpu(di->id2.i_chain.cl_cpg) * le16_to_cpu(di->id2.i_chain.cl_bpc);
if (le16_to_cpu(gd->bg_bits) > max_bits) { if (le16_to_cpu(gd->bg_bits) > max_bits) {
do_error("Group descriptor #%llu has bit count of %u", do_error("Group descriptor #%llu has bit count of %u\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le16_to_cpu(gd->bg_bits)); le16_to_cpu(gd->bg_bits));
} }
...@@ -247,7 +242,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, ...@@ -247,7 +242,7 @@ static int ocfs2_validate_gd_parent(struct super_block *sb,
le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) || le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) ||
((le16_to_cpu(gd->bg_chain) == ((le16_to_cpu(gd->bg_chain) ==
le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) && !resize)) { le16_to_cpu(di->id2.i_chain.cl_next_free_rec)) && !resize)) {
do_error("Group descriptor #%llu has bad chain %u", do_error("Group descriptor #%llu has bad chain %u\n",
(unsigned long long)bh->b_blocknr, (unsigned long long)bh->b_blocknr,
le16_to_cpu(gd->bg_chain)); le16_to_cpu(gd->bg_chain));
} }
...@@ -376,10 +371,10 @@ static int ocfs2_block_group_fill(handle_t *handle, ...@@ -376,10 +371,10 @@ static int ocfs2_block_group_fill(handle_t *handle,
struct super_block * sb = alloc_inode->i_sb; struct super_block * sb = alloc_inode->i_sb;
if (((unsigned long long) bg_bh->b_blocknr) != group_blkno) { if (((unsigned long long) bg_bh->b_blocknr) != group_blkno) {
status = ocfs2_error(alloc_inode->i_sb, "group block (%llu) != " status = ocfs2_error(alloc_inode->i_sb,
"b_blocknr (%llu)", "group block (%llu) != b_blocknr (%llu)\n",
(unsigned long long)group_blkno, (unsigned long long)group_blkno,
(unsigned long long) bg_bh->b_blocknr); (unsigned long long) bg_bh->b_blocknr);
goto bail; goto bail;
} }
...@@ -825,8 +820,9 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb, ...@@ -825,8 +820,9 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
BUG_ON(!OCFS2_IS_VALID_DINODE(fe)); BUG_ON(!OCFS2_IS_VALID_DINODE(fe));
if (!(fe->i_flags & cpu_to_le32(OCFS2_CHAIN_FL))) { if (!(fe->i_flags & cpu_to_le32(OCFS2_CHAIN_FL))) {
status = ocfs2_error(alloc_inode->i_sb, "Invalid chain allocator %llu", status = ocfs2_error(alloc_inode->i_sb,
(unsigned long long)le64_to_cpu(fe->i_blkno)); "Invalid chain allocator %llu\n",
(unsigned long long)le64_to_cpu(fe->i_blkno));
goto bail; goto bail;
} }
...@@ -1360,11 +1356,11 @@ int ocfs2_block_group_set_bits(handle_t *handle, ...@@ -1360,11 +1356,11 @@ int ocfs2_block_group_set_bits(handle_t *handle,
le16_add_cpu(&bg->bg_free_bits_count, -num_bits); le16_add_cpu(&bg->bg_free_bits_count, -num_bits);
if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) { if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit" return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
" count %u but claims %u are freed. num_bits %d", (unsigned long long)le64_to_cpu(bg->bg_blkno),
(unsigned long long)le64_to_cpu(bg->bg_blkno), le16_to_cpu(bg->bg_bits),
le16_to_cpu(bg->bg_bits), le16_to_cpu(bg->bg_free_bits_count),
le16_to_cpu(bg->bg_free_bits_count), num_bits); num_bits);
} }
while(num_bits--) while(num_bits--)
ocfs2_set_bit(bit_off++, bitmap); ocfs2_set_bit(bit_off++, bitmap);
...@@ -1895,11 +1891,10 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac, ...@@ -1895,11 +1891,10 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
if (le32_to_cpu(fe->id1.bitmap1.i_used) >= if (le32_to_cpu(fe->id1.bitmap1.i_used) >=
le32_to_cpu(fe->id1.bitmap1.i_total)) { le32_to_cpu(fe->id1.bitmap1.i_total)) {
status = ocfs2_error(ac->ac_inode->i_sb, status = ocfs2_error(ac->ac_inode->i_sb,
"Chain allocator dinode %llu has %u used " "Chain allocator dinode %llu has %u used bits but only %u total\n",
"bits but only %u total.", (unsigned long long)le64_to_cpu(fe->i_blkno),
(unsigned long long)le64_to_cpu(fe->i_blkno), le32_to_cpu(fe->id1.bitmap1.i_used),
le32_to_cpu(fe->id1.bitmap1.i_used), le32_to_cpu(fe->id1.bitmap1.i_total));
le32_to_cpu(fe->id1.bitmap1.i_total));
goto bail; goto bail;
} }
...@@ -2417,11 +2412,11 @@ static int ocfs2_block_group_clear_bits(handle_t *handle, ...@@ -2417,11 +2412,11 @@ static int ocfs2_block_group_clear_bits(handle_t *handle,
} }
le16_add_cpu(&bg->bg_free_bits_count, num_bits); le16_add_cpu(&bg->bg_free_bits_count, num_bits);
if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) { if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) {
return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit" return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n",
" count %u but claims %u are freed. num_bits %d", (unsigned long long)le64_to_cpu(bg->bg_blkno),
(unsigned long long)le64_to_cpu(bg->bg_blkno), le16_to_cpu(bg->bg_bits),
le16_to_cpu(bg->bg_bits), le16_to_cpu(bg->bg_free_bits_count),
le16_to_cpu(bg->bg_free_bits_count), num_bits); num_bits);
} }
if (undo_fn) if (undo_fn)
......
...@@ -2600,7 +2600,7 @@ int __ocfs2_error(struct super_block *sb, const char *function, ...@@ -2600,7 +2600,7 @@ int __ocfs2_error(struct super_block *sb, const char *function,
/* Not using mlog here because we want to show the actual /* Not using mlog here because we want to show the actual
* function the error came from. */ * function the error came from. */
printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %pV\n", printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %pV",
sb->s_id, function, &vaf); sb->s_id, function, &vaf);
va_end(args); va_end(args);
...@@ -2622,7 +2622,7 @@ void __ocfs2_abort(struct super_block *sb, const char *function, ...@@ -2622,7 +2622,7 @@ void __ocfs2_abort(struct super_block *sb, const char *function,
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
printk(KERN_CRIT "OCFS2: abort (device %s): %s: %pV\n", printk(KERN_CRIT "OCFS2: abort (device %s): %s: %pV",
sb->s_id, function, &vaf); sb->s_id, function, &vaf);
va_end(args); va_end(args);
......
...@@ -35,13 +35,15 @@ __printf(3, 4) ...@@ -35,13 +35,15 @@ __printf(3, 4)
int __ocfs2_error(struct super_block *sb, const char *function, int __ocfs2_error(struct super_block *sb, const char *function,
const char *fmt, ...); const char *fmt, ...);
#define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args) #define ocfs2_error(sb, fmt, ...) \
__ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##__VA_ARGS__)
__printf(3, 4) __printf(3, 4)
void __ocfs2_abort(struct super_block *sb, const char *function, void __ocfs2_abort(struct super_block *sb, const char *function,
const char *fmt, ...); const char *fmt, ...);
#define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args) #define ocfs2_abort(sb, fmt, ...) \
__ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##__VA_ARGS__)
/* /*
* Void signal blockers, because in-kernel sigprocmask() only fails * Void signal blockers, because in-kernel sigprocmask() only fails
......
...@@ -500,26 +500,23 @@ static int ocfs2_validate_xattr_block(struct super_block *sb, ...@@ -500,26 +500,23 @@ static int ocfs2_validate_xattr_block(struct super_block *sb,
if (!OCFS2_IS_VALID_XATTR_BLOCK(xb)) { if (!OCFS2_IS_VALID_XATTR_BLOCK(xb)) {
return ocfs2_error(sb, return ocfs2_error(sb,
"Extended attribute block #%llu has bad " "Extended attribute block #%llu has bad signature %.*s\n",
"signature %.*s", (unsigned long long)bh->b_blocknr, 7,
(unsigned long long)bh->b_blocknr, 7, xb->xb_signature);
xb->xb_signature);
} }
if (le64_to_cpu(xb->xb_blkno) != bh->b_blocknr) { if (le64_to_cpu(xb->xb_blkno) != bh->b_blocknr) {
return ocfs2_error(sb, return ocfs2_error(sb,
"Extended attribute block #%llu has an " "Extended attribute block #%llu has an invalid xb_blkno of %llu\n",
"invalid xb_blkno of %llu", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, (unsigned long long)le64_to_cpu(xb->xb_blkno));
(unsigned long long)le64_to_cpu(xb->xb_blkno));
} }
if (le32_to_cpu(xb->xb_fs_generation) != OCFS2_SB(sb)->fs_generation) { if (le32_to_cpu(xb->xb_fs_generation) != OCFS2_SB(sb)->fs_generation) {
return ocfs2_error(sb, return ocfs2_error(sb,
"Extended attribute block #%llu has an invalid " "Extended attribute block #%llu has an invalid xb_fs_generation of #%u\n",
"xb_fs_generation of #%u", (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, le32_to_cpu(xb->xb_fs_generation));
le32_to_cpu(xb->xb_fs_generation));
} }
return 0; return 0;
...@@ -3692,9 +3689,9 @@ static int ocfs2_xattr_get_rec(struct inode *inode, ...@@ -3692,9 +3689,9 @@ static int ocfs2_xattr_get_rec(struct inode *inode,
if (el->l_tree_depth) { if (el->l_tree_depth) {
ret = ocfs2_error(inode->i_sb, ret = ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in " "Inode %lu has non zero tree depth in xattr tree block %llu\n",
"xattr tree block %llu\n", inode->i_ino, inode->i_ino,
(unsigned long long)eb_bh->b_blocknr); (unsigned long long)eb_bh->b_blocknr);
goto out; goto out;
} }
} }
...@@ -3709,10 +3706,10 @@ static int ocfs2_xattr_get_rec(struct inode *inode, ...@@ -3709,10 +3706,10 @@ static int ocfs2_xattr_get_rec(struct inode *inode,
} }
if (!e_blkno) { if (!e_blkno) {
ret = ocfs2_error(inode->i_sb, "Inode %lu has bad extent " ret = ocfs2_error(inode->i_sb, "Inode %lu has bad extent record (%u, %u, 0) in xattr\n",
"record (%u, %u, 0) in xattr", inode->i_ino, inode->i_ino,
le32_to_cpu(rec->e_cpos), le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec)); ocfs2_rec_clusters(el, rec));
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment