aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-08-15 01:06:31 -0400
committerLen Brown <len.brown@intel.com>2010-08-15 01:06:31 -0400
commit95ee46aa8698f2000647dfb362400fadbb5807cf (patch)
treee5a05c7297f997e191c73091934e42e3195c0e40 /fs/open.c
parentcfa806f059801dbe7e435745eb2e187c8bfe1e7f (diff)
parent92fa5bd9a946b6e7aab6764e7312e4e3d9bed295 (diff)
Merge branch 'linus' into release
Conflicts: drivers/acpi/debug.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/open.c b/fs/open.c
index 5463266db9e6..630715f9f73d 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -29,6 +29,7 @@
29#include <linux/falloc.h> 29#include <linux/falloc.h>
30#include <linux/fs_struct.h> 30#include <linux/fs_struct.h>
31#include <linux/ima.h> 31#include <linux/ima.h>
32#include <linux/dnotify.h>
32 33
33#include "internal.h" 34#include "internal.h"
34 35
@@ -110,7 +111,7 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
110 111
111 error = locks_verify_truncate(inode, NULL, length); 112 error = locks_verify_truncate(inode, NULL, length);
112 if (!error) 113 if (!error)
113 error = security_path_truncate(&path, length, 0); 114 error = security_path_truncate(&path);
114 if (!error) 115 if (!error)
115 error = do_truncate(path.dentry, length, 0, NULL); 116 error = do_truncate(path.dentry, length, 0, NULL);
116 117
@@ -165,8 +166,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
165 166
166 error = locks_verify_truncate(inode, file, length); 167 error = locks_verify_truncate(inode, file, length);
167 if (!error) 168 if (!error)
168 error = security_path_truncate(&file->f_path, length, 169 error = security_path_truncate(&file->f_path);
169 ATTR_MTIME|ATTR_CTIME);
170 if (!error) 170 if (!error)
171 error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file); 171 error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file);
172out_putf: 172out_putf:
@@ -367,7 +367,7 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename)
367 if (error) 367 if (error)
368 goto out; 368 goto out;
369 369
370 error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); 370 error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR);
371 if (error) 371 if (error)
372 goto dput_and_out; 372 goto dput_and_out;
373 373
@@ -396,7 +396,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
396 if (!S_ISDIR(inode->i_mode)) 396 if (!S_ISDIR(inode->i_mode))
397 goto out_putf; 397 goto out_putf;
398 398
399 error = inode_permission(inode, MAY_EXEC | MAY_ACCESS); 399 error = inode_permission(inode, MAY_EXEC | MAY_CHDIR);
400 if (!error) 400 if (!error)
401 set_fs_pwd(current->fs, &file->f_path); 401 set_fs_pwd(current->fs, &file->f_path);
402out_putf: 402out_putf:
@@ -414,7 +414,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
414 if (error) 414 if (error)
415 goto out; 415 goto out;
416 416
417 error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_ACCESS); 417 error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR);
418 if (error) 418 if (error)
419 goto dput_and_out; 419 goto dput_and_out;
420 420
@@ -888,7 +888,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
888 put_unused_fd(fd); 888 put_unused_fd(fd);
889 fd = PTR_ERR(f); 889 fd = PTR_ERR(f);
890 } else { 890 } else {
891 fsnotify_open(f->f_path.dentry); 891 fsnotify_open(f);
892 fd_install(fd, f); 892 fd_install(fd, f);
893 } 893 }
894 } 894 }
@@ -1031,7 +1031,9 @@ EXPORT_SYMBOL(generic_file_open);
1031 1031
1032/* 1032/*
1033 * This is used by subsystems that don't want seekable 1033 * This is used by subsystems that don't want seekable
1034 * file descriptors 1034 * file descriptors. The function is not supposed to ever fail, the only
1035 * reason it returns an 'int' and not 'void' is so that it can be plugged
1036 * directly into file_operations structure.
1035 */ 1037 */
1036int nonseekable_open(struct inode *inode, struct file *filp) 1038int nonseekable_open(struct inode *inode, struct file *filp)
1037{ 1039{