aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_export.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-13 07:27:43 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-13 07:27:43 -0500
commit7359a19cc758946aba0e45233b8641256b194884 (patch)
treed96aaeb2fb239efe6fdb0b4698eb94108719f423 /fs/gfs2/ops_export.c
parent18ec7d5c3f434aed9661ed10a9e1f48cdeb4981d (diff)
[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/ops_export.c')
-rw-r--r--fs/gfs2/ops_export.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c
index 335448d3be21..8389f771d28b 100644
--- a/fs/gfs2/ops_export.c
+++ b/fs/gfs2/ops_export.c
@@ -169,23 +169,16 @@ static struct dentry *gfs2_get_parent(struct dentry *child)
169{ 169{
170 struct gfs2_inode *dip = get_v2ip(child->d_inode); 170 struct gfs2_inode *dip = get_v2ip(child->d_inode);
171 struct qstr dotdot = { .name = "..", .len = 2 }; 171 struct qstr dotdot = { .name = "..", .len = 2 };
172 struct gfs2_inode *ip;
173 struct inode *inode; 172 struct inode *inode;
174 struct dentry *dentry; 173 struct dentry *dentry;
175 int error; 174 int error;
176 175
177 atomic_inc(&dip->i_sbd->sd_ops_export); 176 atomic_inc(&dip->i_sbd->sd_ops_export);
178 177
179 error = gfs2_lookupi(dip, &dotdot, 1, &ip); 178 error = gfs2_lookupi(child->d_inode, &dotdot, 1, &inode);
180 if (error) 179 if (error)
181 return ERR_PTR(error); 180 return ERR_PTR(error);
182 181
183 inode = gfs2_ip2v(ip);
184 gfs2_inode_put(ip);
185
186 if (!inode)
187 return ERR_PTR(-ENOMEM);
188
189 dentry = d_alloc_anon(inode); 182 dentry = d_alloc_anon(inode);
190 if (!dentry) { 183 if (!dentry) {
191 iput(inode); 184 iput(inode);