aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/open.c b/fs/open.c
index 4d690e33446f..e58382d57e72 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -459,8 +459,17 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
459 if(res || !(mode & S_IWOTH) || 459 if(res || !(mode & S_IWOTH) ||
460 special_file(nd.path.dentry->d_inode->i_mode)) 460 special_file(nd.path.dentry->d_inode->i_mode))
461 goto out_path_release; 461 goto out_path_release;
462 462 /*
463 if(IS_RDONLY(nd.path.dentry->d_inode)) 463 * This is a rare case where using __mnt_is_readonly()
464 * is OK without a mnt_want/drop_write() pair. Since
465 * no actual write to the fs is performed here, we do
466 * not need to telegraph to that to anyone.
467 *
468 * By doing this, we accept that this access is
469 * inherently racy and know that the fs may change
470 * state before we even see this result.
471 */
472 if (__mnt_is_readonly(nd.path.mnt))
464 res = -EROFS; 473 res = -EROFS;
465 474
466out_path_release: 475out_path_release: