diff options
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 100672d2c6c5..01f89c727cc8 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -776,9 +776,9 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, | |||
776 | goto got_dent; | 776 | goto got_dent; |
777 | leaf = (struct gfs2_leaf *)bh->b_data; | 777 | leaf = (struct gfs2_leaf *)bh->b_data; |
778 | ln = be64_to_cpu(leaf->lf_next); | 778 | ln = be64_to_cpu(leaf->lf_next); |
779 | brelse(bh); | ||
779 | if (!ln) | 780 | if (!ln) |
780 | break; | 781 | break; |
781 | brelse(bh); | ||
782 | error = get_leaf(ip, ln, &bh); | 782 | error = get_leaf(ip, ln, &bh); |
783 | } while(!error); | 783 | } while(!error); |
784 | 784 | ||
@@ -790,7 +790,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, | |||
790 | return ERR_PTR(error); | 790 | return ERR_PTR(error); |
791 | dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, scan, name, NULL); | 791 | dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, scan, name, NULL); |
792 | got_dent: | 792 | got_dent: |
793 | if (unlikely(IS_ERR(dent))) { | 793 | if (unlikely(dent == NULL || IS_ERR(dent))) { |
794 | brelse(bh); | 794 | brelse(bh); |
795 | bh = NULL; | 795 | bh = NULL; |
796 | } | 796 | } |
@@ -1477,7 +1477,6 @@ int gfs2_dir_search(struct inode *dir, const struct qstr *name, | |||
1477 | brelse(bh); | 1477 | brelse(bh); |
1478 | return 0; | 1478 | return 0; |
1479 | } | 1479 | } |
1480 | brelse(bh); | ||
1481 | return -ENOENT; | 1480 | return -ENOENT; |
1482 | } | 1481 | } |
1483 | 1482 | ||
@@ -1619,7 +1618,6 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *name) | |||
1619 | previous entry otherwise */ | 1618 | previous entry otherwise */ |
1620 | dent = gfs2_dirent_search(dip->i_vnode, name, gfs2_dirent_prev, &bh); | 1619 | dent = gfs2_dirent_search(dip->i_vnode, name, gfs2_dirent_prev, &bh); |
1621 | if (!dent) { | 1620 | if (!dent) { |
1622 | brelse(bh); | ||
1623 | gfs2_consist_inode(dip); | 1621 | gfs2_consist_inode(dip); |
1624 | return -EIO; | 1622 | return -EIO; |
1625 | } | 1623 | } |
@@ -1680,7 +1678,6 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, | |||
1680 | 1678 | ||
1681 | dent = gfs2_dirent_search(dip->i_vnode, filename, gfs2_dirent_find, &bh); | 1679 | dent = gfs2_dirent_search(dip->i_vnode, filename, gfs2_dirent_find, &bh); |
1682 | if (!dent) { | 1680 | if (!dent) { |
1683 | brelse(bh); | ||
1684 | gfs2_consist_inode(dip); | 1681 | gfs2_consist_inode(dip); |
1685 | return -EIO; | 1682 | return -EIO; |
1686 | } | 1683 | } |
@@ -1961,7 +1958,6 @@ int gfs2_diradd_alloc_required(struct inode *inode, | |||
1961 | 1958 | ||
1962 | dent = gfs2_dirent_search(inode, name, gfs2_dirent_find_space, &bh); | 1959 | dent = gfs2_dirent_search(inode, name, gfs2_dirent_find_space, &bh); |
1963 | if (!dent) { | 1960 | if (!dent) { |
1964 | brelse(bh); | ||
1965 | return 1; | 1961 | return 1; |
1966 | } | 1962 | } |
1967 | if (IS_ERR(dent)) | 1963 | if (IS_ERR(dent)) |