summaryrefslogtreecommitdiff
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-10-20 18:20:43 -0700
committerMark Fasheh <mfasheh@suse.com>2008-11-10 09:51:44 -0800
commitf6087fb799e097e7c9d912daa75701de9d62dc53 (patch)
tree010e8455fa5e53e68c76b949b4abd39876c2921f /fs/ocfs2/ocfs2.h
parentc988fd045f1195e62c0970384903ab9da26a9359 (diff)
ocfs2: Check xattr block signatures properly.
The xattr.c code is currently memcmp()ing naking buffer pointers. Create the OCFS2_IS_VALID_XATTR_BLOCK() macro to match its peers and use that. In addition, failed signature checks were returning -EFAULT, which is completely wrong. Return -EIO. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r--fs/ocfs2/ocfs2.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index a21a465490c4..fef7ece32376 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -473,6 +473,9 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
(____gd)->bg_signature); \
} while (0)
+#define OCFS2_IS_VALID_XATTR_BLOCK(ptr) \
+ (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE))
+
static inline unsigned long ino_from_blkno(struct super_block *sb,
u64 blkno)
{