diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index dad4b80257db..68921d9b5302 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 |
@@ -1640,6 +1638,7 @@ struct file *do_filp_open(int dfd, const char *pathname, | |||
1640 | if (filp == NULL) | 1638 | if (filp == NULL) |
1641 | return ERR_PTR(-ENFILE); | 1639 | return ERR_PTR(-ENFILE); |
1642 | nd.intent.open.file = filp; | 1640 | nd.intent.open.file = filp; |
1641 | filp->f_flags = open_flag; | ||
1643 | nd.intent.open.flags = flag; | 1642 | nd.intent.open.flags = flag; |
1644 | nd.intent.open.create_mode = 0; | 1643 | nd.intent.open.create_mode = 0; |
1645 | error = do_path_lookup(dfd, pathname, | 1644 | error = do_path_lookup(dfd, pathname, |
@@ -1685,6 +1684,7 @@ struct file *do_filp_open(int dfd, const char *pathname, | |||
1685 | if (filp == NULL) | 1684 | if (filp == NULL) |
1686 | goto exit_parent; | 1685 | goto exit_parent; |
1687 | nd.intent.open.file = filp; | 1686 | nd.intent.open.file = filp; |
1687 | filp->f_flags = open_flag; | ||
1688 | nd.intent.open.flags = flag; | 1688 | nd.intent.open.flags = flag; |
1689 | nd.intent.open.create_mode = mode; | 1689 | nd.intent.open.create_mode = mode; |
1690 | dir = nd.path.dentry; | 1690 | dir = nd.path.dentry; |
@@ -1725,7 +1725,7 @@ do_last: | |||
1725 | mnt_drop_write(nd.path.mnt); | 1725 | mnt_drop_write(nd.path.mnt); |
1726 | goto exit; | 1726 | goto exit; |
1727 | } | 1727 | } |
1728 | filp = nameidata_to_filp(&nd, open_flag); | 1728 | filp = nameidata_to_filp(&nd); |
1729 | mnt_drop_write(nd.path.mnt); | 1729 | mnt_drop_write(nd.path.mnt); |
1730 | if (nd.root.mnt) | 1730 | if (nd.root.mnt) |
1731 | path_put(&nd.root); | 1731 | path_put(&nd.root); |
@@ -1789,7 +1789,7 @@ ok: | |||
1789 | mnt_drop_write(nd.path.mnt); | 1789 | mnt_drop_write(nd.path.mnt); |
1790 | goto exit; | 1790 | goto exit; |
1791 | } | 1791 | } |
1792 | filp = nameidata_to_filp(&nd, open_flag); | 1792 | filp = nameidata_to_filp(&nd); |
1793 | if (!IS_ERR(filp)) { | 1793 | if (!IS_ERR(filp)) { |
1794 | error = ima_path_check(&filp->f_path, filp->f_mode & | 1794 | error = ima_path_check(&filp->f_path, filp->f_mode & |
1795 | (MAY_READ | MAY_WRITE | MAY_EXEC)); | 1795 | (MAY_READ | MAY_WRITE | MAY_EXEC)); |