Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90960
b: refs/heads/master
c: 2f676cb
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Al Viro committed Apr 19, 2008
1 parent f220275 commit e28b4c7
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 9ac9b8474c39c3ae2c2b37d8e1f08db8a9146124
refs/heads/master: 2f676cbc0d60ae806216c7a61c6971bd72dedde8
13 changes: 11 additions & 2 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,17 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
if(res || !(mode & S_IWOTH) ||
special_file(nd.path.dentry->d_inode->i_mode))
goto out_path_release;

if(IS_RDONLY(nd.path.dentry->d_inode))
/*
* This is a rare case where using __mnt_is_readonly()
* is OK without a mnt_want/drop_write() pair. Since
* no actual write to the fs is performed here, we do
* not need to telegraph to that to anyone.
*
* By doing this, we accept that this access is
* inherently racy and know that the fs may change
* state before we even see this result.
*/
if (__mnt_is_readonly(nd.path.mnt))
res = -EROFS;

out_path_release:
Expand Down

0 comments on commit e28b4c7

Please sign in to comment.