Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9b44f1b3
Commit
9b44f1b3
authored
Mar 09, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move may_open() from __open_name_create() to do_last()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0f9d1a10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
fs/namei.c
fs/namei.c
+7
-5
No files found.
fs/namei.c
View file @
9b44f1b3
...
...
@@ -2069,11 +2069,7 @@ static int __open_namei_create(struct nameidata *nd, struct path *path,
mutex_unlock
(
&
dir
->
d_inode
->
i_mutex
);
dput
(
nd
->
path
.
dentry
);
nd
->
path
.
dentry
=
path
->
dentry
;
if
(
error
)
return
error
;
/* Don't check for write permission, don't truncate */
return
may_open
(
&
nd
->
path
,
0
,
open_flag
&
~
O_TRUNC
);
return
error
;
}
/*
...
...
@@ -2239,6 +2235,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
mnt_drop_write
(
nd
->
path
.
mnt
);
goto
exit
;
}
/* Don't check for write permission, don't truncate */
error
=
may_open
(
&
nd
->
path
,
0
,
op
->
open_flag
&
~
O_TRUNC
);
if
(
error
)
{
mnt_drop_write
(
nd
->
path
.
mnt
);
goto
exit
;
}
filp
=
nameidata_to_filp
(
nd
);
mnt_drop_write
(
nd
->
path
.
mnt
);
path_put
(
&
nd
->
path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment