Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19661
b: refs/heads/master
c: 7d95c8f
h: refs/heads/master
i:
  19659: cbec939
v: v3
  • Loading branch information
dean gaudet authored and Linus Torvalds committed Feb 3, 2006
1 parent ec00a65 commit 6d387f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 8b3e09e19932835fb77c63aaf3b1af6117e78871
refs/heads/master: 7d95c8f27d9be65bf160f1edaf653d33dfceb58c
7 changes: 5 additions & 2 deletions trunk/fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
struct inode * inode = filp->f_dentry->d_inode;
int error = 0;

/* O_APPEND cannot be cleared if the file is marked as append-only */
if (!(arg & O_APPEND) && IS_APPEND(inode))
/*
* O_APPEND cannot be cleared if the file is marked as append-only
* and the file is open for write.
*/
if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode))
return -EPERM;

/* O_NOATIME can only be set by the owner or superuser */
Expand Down

0 comments on commit 6d387f6

Please sign in to comment.