summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.de>2015-09-04 18:44:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 19:54:41 -0400
commit17a5b9ab32fe0464e7f556e28a2b49d2023fb533 (patch)
treecc05fa0cd282c144f3c1a30c8bf6b84a150db660 /fs/ocfs2/alloc.c
parent7d0fb9148ab6f52006de7cce18860227594ba872 (diff)
ocfs2: acknowledge return value of ocfs2_error()
Caveat: This may return -EROFS for a read case, which seems wrong. This is happening even without this patch series though. Should we convert EROFS to EIO? Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 5997c00a1515..9a0fd494fe74 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -908,32 +908,32 @@ static int ocfs2_validate_extent_block(struct super_block *sb,
908 */ 908 */
909 909
910 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) { 910 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) {
911 ocfs2_error(sb, 911 rc = ocfs2_error(sb,
912 "Extent block #%llu has bad signature %.*s", 912 "Extent block #%llu has bad signature %.*s",
913 (unsigned long long)bh->b_blocknr, 7, 913 (unsigned long long)bh->b_blocknr, 7,
914 eb->h_signature); 914 eb->h_signature);
915 return -EINVAL; 915 goto bail;
916 } 916 }
917 917
918 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) { 918 if (le64_to_cpu(eb->h_blkno) != bh->b_blocknr) {
919 ocfs2_error(sb, 919 rc = ocfs2_error(sb,
920 "Extent block #%llu has an invalid h_blkno " 920 "Extent block #%llu has an invalid h_blkno "
921 "of %llu", 921 "of %llu",
922 (unsigned long long)bh->b_blocknr, 922 (unsigned long long)bh->b_blocknr,
923 (unsigned long long)le64_to_cpu(eb->h_blkno)); 923 (unsigned long long)le64_to_cpu(eb->h_blkno));
924 return -EINVAL; 924 goto bail;
925 } 925 }
926 926
927 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) { 927 if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) {
928 ocfs2_error(sb, 928 rc = ocfs2_error(sb,
929 "Extent block #%llu has an invalid " 929 "Extent block #%llu has an invalid "
930 "h_fs_generation of #%u", 930 "h_fs_generation of #%u",
931 (unsigned long long)bh->b_blocknr, 931 (unsigned long long)bh->b_blocknr,
932 le32_to_cpu(eb->h_fs_generation)); 932 le32_to_cpu(eb->h_fs_generation));
933 return -EINVAL; 933 goto bail;
934 } 934 }
935 935bail:
936 return 0; 936 return rc;
937} 937}
938 938
939int ocfs2_read_extent_block(struct ocfs2_caching_info *ci, u64 eb_blkno, 939int ocfs2_read_extent_block(struct ocfs2_caching_info *ci, u64 eb_blkno,