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
7d90b853
Commit
7d90b853
authored
Jul 04, 2017
by
Miklos Szeredi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ovl: extract helper to get temp file in copy up
Signed-off-by:
Miklos Szeredi
<
mszeredi@redhat.com
>
parent
15932c41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
18 deletions
+41
-18
fs/overlayfs/copy_up.c
fs/overlayfs/copy_up.c
+41
-18
No files found.
fs/overlayfs/copy_up.c
View file @
7d90b853
...
...
@@ -345,16 +345,13 @@ static int ovl_install_temp(struct dentry *workdir, struct dentry *upperdir,
return
err
;
}
static
int
ovl_
copy_up_locked
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
const
char
*
link
,
struct
kstat
*
pstat
,
bool
tmpfile
)
static
int
ovl_
get_tmpfile
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
struct
dentry
*
dentry
,
struct
kstat
*
stat
,
const
char
*
link
,
bool
tmpfile
,
struct
dentry
**
tempp
)
{
struct
inode
*
wdir
=
workdir
->
d_inode
;
struct
inode
*
udir
=
upperdir
->
d_inode
;
struct
dentry
*
newdentry
=
NULL
;
struct
dentry
*
temp
=
NULL
;
int
err
;
struct
dentry
*
temp
;
const
struct
cred
*
old_creds
=
NULL
;
struct
cred
*
new_creds
=
NULL
;
struct
cattr
cattr
=
{
...
...
@@ -371,24 +368,50 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
if
(
new_creds
)
old_creds
=
override_creds
(
new_creds
);
if
(
tmpfile
)
if
(
tmpfile
)
{
temp
=
ovl_do_tmpfile
(
upperdir
,
stat
->
mode
);
else
if
(
IS_ERR
(
temp
))
goto
temp_err
;
}
else
{
temp
=
ovl_lookup_temp
(
workdir
);
err
=
0
;
if
(
IS_ERR
(
temp
))
{
err
=
PTR_ERR
(
temp
);
temp
=
NULL
;
}
if
(
!
err
&&
!
tmpfile
)
err
=
ovl_create_real
(
wdir
,
temp
,
&
cattr
,
NULL
,
true
);
if
(
IS_ERR
(
temp
))
goto
temp_err
;
err
=
ovl_create_real
(
d_inode
(
workdir
),
temp
,
&
cattr
,
NULL
,
true
);
if
(
err
)
{
dput
(
temp
);
goto
out
;
}
}
err
=
0
;
*
tempp
=
temp
;
out:
if
(
new_creds
)
{
revert_creds
(
old_creds
);
put_cred
(
new_creds
);
}
return
err
;
temp_err:
err
=
PTR_ERR
(
temp
);
goto
out
;
}
static
int
ovl_copy_up_locked
(
struct
dentry
*
workdir
,
struct
dentry
*
upperdir
,
struct
dentry
*
dentry
,
struct
path
*
lowerpath
,
struct
kstat
*
stat
,
const
char
*
link
,
struct
kstat
*
pstat
,
bool
tmpfile
)
{
struct
inode
*
wdir
=
workdir
->
d_inode
;
struct
inode
*
udir
=
upperdir
->
d_inode
;
struct
dentry
*
newdentry
=
NULL
;
struct
dentry
*
temp
=
NULL
;
int
err
;
err
=
ovl_get_tmpfile
(
workdir
,
upperdir
,
dentry
,
stat
,
link
,
tmpfile
,
&
temp
);
if
(
err
)
goto
out
;
...
...
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