Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43303
b: refs/heads/master
c: 300c7d7
h: refs/heads/master
i:
  43301: d6fb2a0
  43299: 620a5a0
  43295: 0d04f87
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent fb695af commit 0b17ca1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb4c03131836a55bf95e1c165409244ac6b4f39f
refs/heads/master: 300c7d75f3a5e8edd3e390ccd56b808f3fb14e33
19 changes: 13 additions & 6 deletions trunk/fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,10 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
* @mask:
* @nd: passed from Linux VFS, ignored by us
*
* This may be called from the VFS directly, or from within GFS2 with the
* inode locked, so we look to see if the glock is already locked and only
* lock the glock if its not already been done.
*
* Returns: errno
*/

Expand All @@ -843,15 +847,18 @@ static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_holder i_gh;
int error;
int unlock = 0;

if (!test_bit(GIF_INVALID, &ip->i_flags))
return generic_permission(inode, mask, gfs2_check_acl);
if (gfs2_glock_is_locked_by_me(ip->i_gl) == 0) {
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
if (error)
return error;
unlock = 1;
}

error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
if (!error) {
error = generic_permission(inode, mask, gfs2_check_acl_locked);
error = generic_permission(inode, mask, gfs2_check_acl_locked);
if (unlock)
gfs2_glock_dq_uninit(&i_gh);
}

return error;
}
Expand Down

0 comments on commit 0b17ca1

Please sign in to comment.