diff options
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index a7d611b93f0f..c87faf48f0a1 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -1035,14 +1035,19 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1035 | struct buffer_head *bh; | 1035 | struct buffer_head *bh; |
1036 | struct gfs2_holder ghs[3]; | 1036 | struct gfs2_holder ghs[3]; |
1037 | struct gfs2_rgrpd *rgd; | 1037 | struct gfs2_rgrpd *rgd; |
1038 | int error = -EROFS; | 1038 | int error; |
1039 | 1039 | ||
1040 | error = gfs2_rindex_update(sdp); | ||
1041 | if (error) | ||
1042 | return error; | ||
1040 | gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); | 1043 | gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); |
1041 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); | 1044 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); |
1042 | 1045 | ||
1043 | rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); | 1046 | rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); |
1044 | if (!rgd) | 1047 | if (!rgd) { |
1048 | error = -EROFS; | ||
1045 | goto out_inodes; | 1049 | goto out_inodes; |
1050 | } | ||
1046 | gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); | 1051 | gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); |
1047 | 1052 | ||
1048 | 1053 | ||