diff options
Diffstat (limited to 'fs/gfs2/ops_export.c')
-rw-r--r-- | fs/gfs2/ops_export.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c index aad918337a46..51a8a14deb29 100644 --- a/fs/gfs2/ops_export.c +++ b/fs/gfs2/ops_export.c | |||
@@ -75,10 +75,10 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *p, int *len, | |||
75 | (connectable && *len < GFS2_LARGE_FH_SIZE)) | 75 | (connectable && *len < GFS2_LARGE_FH_SIZE)) |
76 | return 255; | 76 | return 255; |
77 | 77 | ||
78 | fh[0] = cpu_to_be32(ip->i_num.no_formal_ino >> 32); | 78 | fh[0] = cpu_to_be32(ip->i_no_formal_ino >> 32); |
79 | fh[1] = cpu_to_be32(ip->i_num.no_formal_ino & 0xFFFFFFFF); | 79 | fh[1] = cpu_to_be32(ip->i_no_formal_ino & 0xFFFFFFFF); |
80 | fh[2] = cpu_to_be32(ip->i_num.no_addr >> 32); | 80 | fh[2] = cpu_to_be32(ip->i_no_addr >> 32); |
81 | fh[3] = cpu_to_be32(ip->i_num.no_addr & 0xFFFFFFFF); | 81 | fh[3] = cpu_to_be32(ip->i_no_addr & 0xFFFFFFFF); |
82 | *len = GFS2_SMALL_FH_SIZE; | 82 | *len = GFS2_SMALL_FH_SIZE; |
83 | 83 | ||
84 | if (!connectable || inode == sb->s_root->d_inode) | 84 | if (!connectable || inode == sb->s_root->d_inode) |
@@ -90,10 +90,10 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *p, int *len, | |||
90 | igrab(inode); | 90 | igrab(inode); |
91 | spin_unlock(&dentry->d_lock); | 91 | spin_unlock(&dentry->d_lock); |
92 | 92 | ||
93 | fh[4] = cpu_to_be32(ip->i_num.no_formal_ino >> 32); | 93 | fh[4] = cpu_to_be32(ip->i_no_formal_ino >> 32); |
94 | fh[5] = cpu_to_be32(ip->i_num.no_formal_ino & 0xFFFFFFFF); | 94 | fh[5] = cpu_to_be32(ip->i_no_formal_ino & 0xFFFFFFFF); |
95 | fh[6] = cpu_to_be32(ip->i_num.no_addr >> 32); | 95 | fh[6] = cpu_to_be32(ip->i_no_addr >> 32); |
96 | fh[7] = cpu_to_be32(ip->i_num.no_addr & 0xFFFFFFFF); | 96 | fh[7] = cpu_to_be32(ip->i_no_addr & 0xFFFFFFFF); |
97 | 97 | ||
98 | fh[8] = cpu_to_be32(inode->i_mode); | 98 | fh[8] = cpu_to_be32(inode->i_mode); |
99 | fh[9] = 0; /* pad to double word */ | 99 | fh[9] = 0; /* pad to double word */ |
@@ -144,7 +144,8 @@ static int gfs2_get_name(struct dentry *parent, char *name, | |||
144 | ip = GFS2_I(inode); | 144 | ip = GFS2_I(inode); |
145 | 145 | ||
146 | *name = 0; | 146 | *name = 0; |
147 | gnfd.inum = ip->i_num; | 147 | gnfd.inum.no_addr = ip->i_no_addr; |
148 | gnfd.inum.no_formal_ino = ip->i_no_formal_ino; | ||
148 | gnfd.name = name; | 149 | gnfd.name = name; |
149 | 150 | ||
150 | error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &gh); | 151 | error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &gh); |
@@ -202,9 +203,9 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_obj) | |||
202 | 203 | ||
203 | /* System files? */ | 204 | /* System files? */ |
204 | 205 | ||
205 | inode = gfs2_ilookup(sb, inum); | 206 | inode = gfs2_ilookup(sb, inum->no_addr); |
206 | if (inode) { | 207 | if (inode) { |
207 | if (GFS2_I(inode)->i_num.no_formal_ino != inum->no_formal_ino) { | 208 | if (GFS2_I(inode)->i_no_formal_ino != inum->no_formal_ino) { |
208 | iput(inode); | 209 | iput(inode); |
209 | return ERR_PTR(-ESTALE); | 210 | return ERR_PTR(-ESTALE); |
210 | } | 211 | } |
@@ -236,7 +237,7 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_obj) | |||
236 | gfs2_glock_dq_uninit(&rgd_gh); | 237 | gfs2_glock_dq_uninit(&rgd_gh); |
237 | gfs2_glock_dq_uninit(&ri_gh); | 238 | gfs2_glock_dq_uninit(&ri_gh); |
238 | 239 | ||
239 | inode = gfs2_inode_lookup(sb, inum, fh_obj->imode); | 240 | inode = gfs2_inode_lookup(sb, inum->no_addr, fh_obj->imode); |
240 | if (!inode) | 241 | if (!inode) |
241 | goto fail; | 242 | goto fail; |
242 | if (IS_ERR(inode)) { | 243 | if (IS_ERR(inode)) { |
@@ -249,6 +250,10 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_obj) | |||
249 | iput(inode); | 250 | iput(inode); |
250 | goto fail; | 251 | goto fail; |
251 | } | 252 | } |
253 | if (GFS2_I(inode)->i_no_formal_ino != inum->no_formal_ino) { | ||
254 | iput(inode); | ||
255 | goto fail; | ||
256 | } | ||
252 | 257 | ||
253 | error = -EIO; | 258 | error = -EIO; |
254 | if (GFS2_I(inode)->i_di.di_flags & GFS2_DIF_SYSTEM) { | 259 | if (GFS2_I(inode)->i_di.di_flags & GFS2_DIF_SYSTEM) { |