Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 70772
b: refs/heads/master
c: b41572e
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Linus Torvalds committed Oct 17, 2007
1 parent 7686656 commit 898b0a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: ce8d2cdf3d2b73e346c82e6f0a46da331df6364c
refs/heads/master: b41572e929221b0d87f529106cdf12185ee84bca
8 changes: 4 additions & 4 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,10 +1604,6 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE))
return -EISDIR;

error = vfs_permission(nd, acc_mode);
if (error)
return error;

/*
* FIFO's, sockets and device files are special: they don't
* actually live on the filesystem itself, and as such you
Expand All @@ -1622,6 +1618,10 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
flag &= ~O_TRUNC;
} else if (IS_RDONLY(inode) && (flag & FMODE_WRITE))
return -EROFS;

error = vfs_permission(nd, acc_mode);
if (error)
return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Expand Down

0 comments on commit 898b0a9

Please sign in to comment.