diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-13 12:27:43 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-13 12:27:43 +0000 |
commit | 7359a19cc758946aba0e45233b8641256b194884 (patch) | |
tree | d96aaeb2fb239efe6fdb0b4698eb94108719f423 /fs/gfs2/recovery.c | |
parent | 18ec7d5c3f434aed9661ed10a9e1f48cdeb4981d (diff) | |
download | op-kernel-dev-7359a19cc758946aba0e45233b8641256b194884.zip op-kernel-dev-7359a19cc758946aba0e45233b8641256b194884.tar.gz |
[GFS2] Fix for root inode ref count bug
Umount is now working correctly again. The bug was due to
not getting an extra ref count when mounting the fs. We
should have bumped it by two (once for the internal pointer
to the root inode from the super block and once for the
inode hanging off the dcache entry for root).
Also this patch tidys up the code dealing with looking up
and creating inodes. We now pass Linux inodes (with gfs2_inodes
attached) rather than the other way around and this reduces code
duplication in various places.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/recovery.c')
-rw-r--r-- | fs/gfs2/recovery.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 15cd26f..bcb81c7 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -27,17 +27,17 @@ int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk, struct buffer_head **bh) { - struct gfs2_glock *gl = jd->jd_inode->i_gl; + struct gfs2_glock *gl = get_v2ip(jd->jd_inode)->i_gl; int new = 0; uint64_t dblock; uint32_t extlen; int error; - error = gfs2_block_map(jd->jd_inode, blk, &new, &dblock, &extlen); + error = gfs2_block_map(get_v2ip(jd->jd_inode), blk, &new, &dblock, &extlen); if (error) return error; if (!dblock) { - gfs2_consist_inode(jd->jd_inode); + gfs2_consist_inode(get_v2ip(jd->jd_inode)); return -EIO; } @@ -184,7 +184,7 @@ static int find_good_lh(struct gfs2_jdesc *jd, unsigned int *blk, *blk = 0; if (*blk == orig_blk) { - gfs2_consist_inode(jd->jd_inode); + gfs2_consist_inode(get_v2ip(jd->jd_inode)); return -EIO; } } @@ -218,7 +218,7 @@ static int jhead_scan(struct gfs2_jdesc *jd, struct gfs2_log_header *head) continue; if (lh.lh_sequence == head->lh_sequence) { - gfs2_consist_inode(jd->jd_inode); + gfs2_consist_inode(get_v2ip(jd->jd_inode)); return -EIO; } if (lh.lh_sequence < head->lh_sequence) @@ -294,7 +294,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header *head) static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start, unsigned int end, int pass) { - struct gfs2_sbd *sdp = jd->jd_inode->i_sbd; + struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd; struct buffer_head *bh; struct gfs2_log_descriptor *ld; int error = 0; @@ -323,7 +323,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start, continue; } if (error == 1) { - gfs2_consist_inode(jd->jd_inode); + gfs2_consist_inode(get_v2ip(jd->jd_inode)); error = -EIO; } brelse(bh); @@ -360,7 +360,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start, static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head) { - struct gfs2_inode *ip = jd->jd_inode; + struct gfs2_inode *ip = get_v2ip(jd->jd_inode); struct gfs2_sbd *sdp = ip->i_sbd; unsigned int lblock; int new = 0; @@ -419,7 +419,7 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head) int gfs2_recover_journal(struct gfs2_jdesc *jd, int wait) { - struct gfs2_sbd *sdp = jd->jd_inode->i_sbd; + struct gfs2_sbd *sdp = get_v2ip(jd->jd_inode)->i_sbd; struct gfs2_log_header head; struct gfs2_holder j_gh, ji_gh, t_gh; unsigned long t; @@ -449,7 +449,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd, int wait) goto fail; }; - error = gfs2_glock_nq_init(jd->jd_inode->i_gl, LM_ST_SHARED, + error = gfs2_glock_nq_init(get_v2ip(jd->jd_inode)->i_gl, LM_ST_SHARED, LM_FLAG_NOEXP, &ji_gh); if (error) goto fail_gunlock_j; |