Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43304
b: refs/heads/master
c: dcf3dd8
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 30, 2006
1 parent 0b17ca1 commit a155a39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 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: 300c7d75f3a5e8edd3e390ccd56b808f3fb14e33
refs/heads/master: dcf3dd852f554bb0016aa23892596717cc123a26
22 changes: 17 additions & 5 deletions trunk/fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,12 @@ static int gfs2_setattr(struct dentry *dentry, struct iattr *attr)
* @dentry: The dentry to stat
* @stat: The inode's stats
*
* 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. Note that its the NFS
* readdirplus operation which causes this to be called (from filldir)
* with the glock already held.
*
* Returns: errno
*/

Expand All @@ -1002,14 +1008,20 @@ static int gfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_holder gh;
int error;
int unlock = 0;

error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh);
if (!error) {
generic_fillattr(inode, stat);
gfs2_glock_dq_uninit(&gh);
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, &gh);
if (error)
return error;
unlock = 1;
}

return error;
generic_fillattr(inode, stat);
if (unlock);
gfs2_glock_dq_uninit(&gh);

return 0;
}

static int gfs2_setxattr(struct dentry *dentry, const char *name,
Expand Down

0 comments on commit a155a39

Please sign in to comment.