aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-01-13 03:58:37 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-13 04:08:50 -0500
commit61405fea92c42d072d9b8bd189689f1502a838af (patch)
tree013ea3e7ed71f4114004d5852d40b6e89e128f76 /fs/namei.c
parent9c443dfdd31eddea6cbe6ee0ca469fbcc4e1dc3b (diff)
parent1703f2c321a8a531c393e137a82602e16c6061cb (diff)
Merge branch 'perf/urgent' into perf/core
Merge reason: queue up dependent patch, update to -rc4 Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index d2783c8a770b..b55440baf7ab 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -37,8 +37,6 @@
37 37
38#include "internal.h" 38#include "internal.h"
39 39
40#define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE])
41
42/* [Feb-1997 T. Schoebel-Theuer] 40/* [Feb-1997 T. Schoebel-Theuer]
43 * Fundamental changes in the pathname lookup mechanisms (namei) 41 * Fundamental changes in the pathname lookup mechanisms (namei)
44 * were necessary because of omirr. The reason is that omirr needs 42 * were necessary because of omirr. The reason is that omirr needs
@@ -234,6 +232,7 @@ int generic_permission(struct inode *inode, int mask,
234 /* 232 /*
235 * Searching includes executable on directories, else just read. 233 * Searching includes executable on directories, else just read.
236 */ 234 */
235 mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
237 if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE))) 236 if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE)))
238 if (capable(CAP_DAC_READ_SEARCH)) 237 if (capable(CAP_DAC_READ_SEARCH))
239 return 0; 238 return 0;
@@ -1640,6 +1639,7 @@ struct file *do_filp_open(int dfd, const char *pathname,
1640 if (filp == NULL) 1639 if (filp == NULL)
1641 return ERR_PTR(-ENFILE); 1640 return ERR_PTR(-ENFILE);
1642 nd.intent.open.file = filp; 1641 nd.intent.open.file = filp;
1642 filp->f_flags = open_flag;
1643 nd.intent.open.flags = flag; 1643 nd.intent.open.flags = flag;
1644 nd.intent.open.create_mode = 0; 1644 nd.intent.open.create_mode = 0;
1645 error = do_path_lookup(dfd, pathname, 1645 error = do_path_lookup(dfd, pathname,
@@ -1685,6 +1685,7 @@ struct file *do_filp_open(int dfd, const char *pathname,
1685 if (filp == NULL) 1685 if (filp == NULL)
1686 goto exit_parent; 1686 goto exit_parent;
1687 nd.intent.open.file = filp; 1687 nd.intent.open.file = filp;
1688 filp->f_flags = open_flag;
1688 nd.intent.open.flags = flag; 1689 nd.intent.open.flags = flag;
1689 nd.intent.open.create_mode = mode; 1690 nd.intent.open.create_mode = mode;
1690 dir = nd.path.dentry; 1691 dir = nd.path.dentry;
@@ -1725,7 +1726,7 @@ do_last:
1725 mnt_drop_write(nd.path.mnt); 1726 mnt_drop_write(nd.path.mnt);
1726 goto exit; 1727 goto exit;
1727 } 1728 }
1728 filp = nameidata_to_filp(&nd, open_flag); 1729 filp = nameidata_to_filp(&nd);
1729 mnt_drop_write(nd.path.mnt); 1730 mnt_drop_write(nd.path.mnt);
1730 if (nd.root.mnt) 1731 if (nd.root.mnt)
1731 path_put(&nd.root); 1732 path_put(&nd.root);
@@ -1764,7 +1765,7 @@ do_last:
1764 1765
1765 path_to_nameidata(&path, &nd); 1766 path_to_nameidata(&path, &nd);
1766 error = -EISDIR; 1767 error = -EISDIR;
1767 if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode)) 1768 if (S_ISDIR(path.dentry->d_inode->i_mode))
1768 goto exit; 1769 goto exit;
1769ok: 1770ok:
1770 /* 1771 /*
@@ -1789,7 +1790,7 @@ ok:
1789 mnt_drop_write(nd.path.mnt); 1790 mnt_drop_write(nd.path.mnt);
1790 goto exit; 1791 goto exit;
1791 } 1792 }
1792 filp = nameidata_to_filp(&nd, open_flag); 1793 filp = nameidata_to_filp(&nd);
1793 if (!IS_ERR(filp)) { 1794 if (!IS_ERR(filp)) {
1794 error = ima_path_check(&filp->f_path, filp->f_mode & 1795 error = ima_path_check(&filp->f_path, filp->f_mode &
1795 (MAY_READ | MAY_WRITE | MAY_EXEC)); 1796 (MAY_READ | MAY_WRITE | MAY_EXEC));