summaryrefslogtreecommitdiff
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.de>2015-09-04 15:44:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 16:54:41 -0700
commit17a5b9ab32fe0464e7f556e28a2b49d2023fb533 (patch)
treecc05fa0cd282c144f3c1a30c8bf6b84a150db660 /fs/ocfs2/xattr.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/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index a24f264b2fc4..5944a311bb94 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -499,30 +499,27 @@ static int ocfs2_validate_xattr_block(struct super_block *sb,
*/
if (!OCFS2_IS_VALID_XATTR_BLOCK(xb)) {
- ocfs2_error(sb,
+ return ocfs2_error(sb,
"Extended attribute block #%llu has bad "
"signature %.*s",
(unsigned long long)bh->b_blocknr, 7,
xb->xb_signature);
- return -EINVAL;
}
if (le64_to_cpu(xb->xb_blkno) != bh->b_blocknr) {
- ocfs2_error(sb,
+ return ocfs2_error(sb,
"Extended attribute block #%llu has an "
"invalid xb_blkno of %llu",
(unsigned long long)bh->b_blocknr,
(unsigned long long)le64_to_cpu(xb->xb_blkno));
- return -EINVAL;
}
if (le32_to_cpu(xb->xb_fs_generation) != OCFS2_SB(sb)->fs_generation) {
- ocfs2_error(sb,
+ return ocfs2_error(sb,
"Extended attribute block #%llu has an invalid "
"xb_fs_generation of #%u",
(unsigned long long)bh->b_blocknr,
le32_to_cpu(xb->xb_fs_generation));
- return -EINVAL;
}
return 0;
@@ -3694,11 +3691,10 @@ static int ocfs2_xattr_get_rec(struct inode *inode,
el = &eb->h_list;
if (el->l_tree_depth) {
- ocfs2_error(inode->i_sb,
+ ret = ocfs2_error(inode->i_sb,
"Inode %lu has non zero tree depth in "
"xattr tree block %llu\n", inode->i_ino,
(unsigned long long)eb_bh->b_blocknr);
- ret = -EROFS;
goto out;
}
}
@@ -3713,11 +3709,10 @@ static int ocfs2_xattr_get_rec(struct inode *inode,
}
if (!e_blkno) {
- 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", inode->i_ino,
le32_to_cpu(rec->e_cpos),
ocfs2_rec_clusters(el, rec));
- ret = -EROFS;
goto out;
}