Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38688
b: refs/heads/master
c: b9cb981
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed May 12, 2006
1 parent 3b7ea54 commit 9962bb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: 9801f6461eb994e4eda29cba97f4596dffafbf32
refs/heads/master: b9cb981310bc22f165726e99385c2d85196e2f41
13 changes: 10 additions & 3 deletions trunk/fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,10 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)

gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
if (error)
if (error) {
gfs2_holder_uninit(&gh);
return error;
}

flags = ip->i_di.di_flags;
new_flags = (flags & ~mask) | (reqflags & mask);
Expand All @@ -635,9 +637,14 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
goto out;
if (IS_APPEND(inode) && (new_flags & GFS2_DIF_APPENDONLY))
goto out;
error = gfs2_repermission(inode, MAY_WRITE, NULL);
if (error)
if (((new_flags ^ flags) & GFS2_DIF_IMMUTABLE) &&
!capable(CAP_LINUX_IMMUTABLE))
goto out;
if (!IS_IMMUTABLE(inode)) {
error = gfs2_repermission(inode, MAY_WRITE, NULL);
if (error)
goto out;
}

error = gfs2_trans_begin(sdp, RES_DINODE, 0);
if (error)
Expand Down

0 comments on commit 9962bb9

Please sign in to comment.