aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-30 15:46:23 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-30 15:46:23 -0500
commite3167ded1f1b16424bc14d5673cdc5414f179970 (patch)
tree1b995e6387b230b1f447aabe30b689d091ee0b52 /fs/gfs2/dir.c
parentcd45697f0ddbb58f3f83c29fe164713ee7765e21 (diff)
[GFS] Fix bug in endian conversion for metadata header
In some cases 16 bit functions were being used rather than 32 bit functions. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r--fs/gfs2/dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 9f17e7d05af1..66917f2c64aa 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -462,7 +462,7 @@ static int gfs2_dirent_offset(const void *buf)
462 462
463 BUG_ON(buf == NULL); 463 BUG_ON(buf == NULL);
464 464
465 switch(be16_to_cpu(h->mh_type)) { 465 switch(be32_to_cpu(h->mh_type)) {
466 case GFS2_METATYPE_LF: 466 case GFS2_METATYPE_LF:
467 offset = sizeof(struct gfs2_leaf); 467 offset = sizeof(struct gfs2_leaf);
468 break; 468 break;
@@ -475,7 +475,7 @@ static int gfs2_dirent_offset(const void *buf)
475 return offset; 475 return offset;
476wrong_type: 476wrong_type:
477 printk(KERN_WARNING "gfs2_scan_dirent: wrong block type %u\n", 477 printk(KERN_WARNING "gfs2_scan_dirent: wrong block type %u\n",
478 be16_to_cpu(h->mh_type)); 478 be32_to_cpu(h->mh_type));
479 return -1; 479 return -1;
480} 480}
481 481
@@ -548,7 +548,7 @@ static int dirent_first(struct gfs2_inode *dip, struct buffer_head *bh,
548{ 548{
549 struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data; 549 struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data;
550 550
551 if (be16_to_cpu(h->mh_type) == GFS2_METATYPE_LF) { 551 if (be32_to_cpu(h->mh_type) == GFS2_METATYPE_LF) {
552 if (gfs2_meta_check(dip->i_sbd, bh)) 552 if (gfs2_meta_check(dip->i_sbd, bh))
553 return -EIO; 553 return -EIO;
554 *dent = (struct gfs2_dirent *)(bh->b_data + 554 *dent = (struct gfs2_dirent *)(bh->b_data +