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
Kirill Smelkov
linux
Commits
1ba10681
Commit
1ba10681
authored
Jun 26, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch do_spufs_create() to user_path_create(), fix double-unlock
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
dae6ad8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
32 deletions
+21
-32
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/cell/spufs/inode.c
+11
-18
arch/powerpc/platforms/cell/spufs/spufs.h
arch/powerpc/platforms/cell/spufs/spufs.h
+1
-1
arch/powerpc/platforms/cell/spufs/syscalls.c
arch/powerpc/platforms/cell/spufs/syscalls.c
+9
-13
No files found.
arch/powerpc/platforms/cell/spufs/inode.c
View file @
1ba10681
...
...
@@ -611,15 +611,14 @@ static int spufs_create_gang(struct inode *inode,
static
struct
file_system_type
spufs_type
;
long
spufs_create
(
struct
nameidata
*
nd
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
filp
)
long
spufs_create
(
struct
path
*
path
,
struct
dentry
*
dentry
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
filp
)
{
struct
dentry
*
dentry
;
int
ret
;
ret
=
-
EINVAL
;
/* check if we are on spufs */
if
(
nd
->
path
.
dentry
->
d_sb
->
s_type
!=
&
spufs_type
)
if
(
path
->
dentry
->
d_sb
->
s_type
!=
&
spufs_type
)
goto
out
;
/* don't accept undefined flags */
...
...
@@ -627,33 +626,27 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
goto
out
;
/* only threads can be underneath a gang */
if
(
nd
->
path
.
dentry
!=
nd
->
path
.
dentry
->
d_sb
->
s_root
)
{
if
(
path
->
dentry
!=
path
->
dentry
->
d_sb
->
s_root
)
{
if
((
flags
&
SPU_CREATE_GANG
)
||
!
SPUFS_I
(
nd
->
path
.
dentry
->
d_inode
)
->
i_gang
)
!
SPUFS_I
(
path
->
dentry
->
d_inode
)
->
i_gang
)
goto
out
;
}
dentry
=
lookup_create
(
nd
,
1
);
ret
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
goto
out_dir
;
mode
&=
~
current_umask
();
if
(
flags
&
SPU_CREATE_GANG
)
ret
=
spufs_create_gang
(
nd
->
path
.
dentry
->
d_inode
,
dentry
,
nd
->
path
.
mnt
,
mode
);
ret
=
spufs_create_gang
(
path
->
dentry
->
d_inode
,
dentry
,
path
->
mnt
,
mode
);
else
ret
=
spufs_create_context
(
nd
->
path
.
dentry
->
d_inode
,
dentry
,
nd
->
path
.
mnt
,
flags
,
mode
,
ret
=
spufs_create_context
(
path
->
dentry
->
d_inode
,
dentry
,
path
->
mnt
,
flags
,
mode
,
filp
);
if
(
ret
>=
0
)
fsnotify_mkdir
(
nd
->
path
.
dentry
->
d_inode
,
dentry
);
fsnotify_mkdir
(
path
->
dentry
->
d_inode
,
dentry
);
return
ret
;
out_dir:
mutex_unlock
(
&
nd
->
path
.
dentry
->
d_inode
->
i_mutex
);
out:
mutex_unlock
(
&
path
->
dentry
->
d_inode
->
i_mutex
);
return
ret
;
}
...
...
arch/powerpc/platforms/cell/spufs/spufs.h
View file @
1ba10681
...
...
@@ -248,7 +248,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[];
/* system call implementation */
extern
struct
spufs_calls
spufs_calls
;
long
spufs_run_spu
(
struct
spu_context
*
ctx
,
u32
*
npc
,
u32
*
status
);
long
spufs_create
(
struct
nameidata
*
nd
,
unsigned
int
flags
,
long
spufs_create
(
struct
path
*
nd
,
struct
dentry
*
dentry
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
filp
);
/* ELF coredump callbacks for writing SPU ELF notes */
extern
int
spufs_coredump_extra_notes_size
(
void
);
...
...
arch/powerpc/platforms/cell/spufs/syscalls.c
View file @
1ba10681
...
...
@@ -62,21 +62,17 @@ static long do_spu_run(struct file *filp,
static
long
do_spu_create
(
const
char
__user
*
pathname
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
neighbor
)
{
char
*
tmp
;
struct
path
path
;
struct
dentry
*
dentry
;
int
ret
;
tmp
=
getname
(
pathname
);
ret
=
PTR_ERR
(
tmp
);
if
(
!
IS_ERR
(
tmp
))
{
struct
nameidata
nd
;
ret
=
kern_path_parent
(
tmp
,
&
nd
);
if
(
!
ret
)
{
nd
.
flags
|=
LOOKUP_OPEN
|
LOOKUP_CREATE
;
ret
=
spufs_create
(
&
nd
,
flags
,
mode
,
neighbor
);
path_put
(
&
nd
.
path
);
}
putname
(
tmp
);
dentry
=
user_path_create
(
AT_FDCWD
,
pathname
,
&
path
,
1
);
ret
=
PTR_ERR
(
dentry
);
if
(
!
IS_ERR
(
dentry
))
{
ret
=
spufs_create
(
&
path
,
dentry
,
flags
,
mode
,
neighbor
);
mutex_unlock
(
&
path
.
dentry
->
d_inode
->
i_mutex
);
dput
(
dentry
);
path_put
(
&
path
);
}
return
ret
;
...
...
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