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
2f91306a
Commit
2f91306a
authored
Apr 11, 2016
by
David Sterba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
btrfs: send: use vmalloc only as fallback for clone_sources_tmp
Signed-off-by:
David Sterba
<
dsterba@suse.com
>
parent
c03d01f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
fs/btrfs/send.c
fs/btrfs/send.c
+8
-5
No files found.
fs/btrfs/send.c
View file @
2f91306a
...
@@ -6065,10 +6065,13 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
...
@@ -6065,10 +6065,13 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
alloc_size
=
arg
->
clone_sources_count
*
sizeof
(
*
arg
->
clone_sources
);
alloc_size
=
arg
->
clone_sources_count
*
sizeof
(
*
arg
->
clone_sources
);
if
(
arg
->
clone_sources_count
)
{
if
(
arg
->
clone_sources_count
)
{
clone_sources_tmp
=
vmalloc
(
alloc_size
);
clone_sources_tmp
=
kmalloc
(
alloc_size
,
GFP_KERNEL
|
__GFP_NOWARN
);
if
(
!
clone_sources_tmp
)
{
if
(
!
clone_sources_tmp
)
{
ret
=
-
ENOMEM
;
clone_sources_tmp
=
vmalloc
(
alloc_size
);
goto
out
;
if
(
!
clone_sources_tmp
)
{
ret
=
-
ENOMEM
;
goto
out
;
}
}
}
ret
=
copy_from_user
(
clone_sources_tmp
,
arg
->
clone_sources
,
ret
=
copy_from_user
(
clone_sources_tmp
,
arg
->
clone_sources
,
...
@@ -6106,7 +6109,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
...
@@ -6106,7 +6109,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
sctx
->
clone_roots
[
i
].
root
=
clone_root
;
sctx
->
clone_roots
[
i
].
root
=
clone_root
;
clone_sources_to_rollback
=
i
+
1
;
clone_sources_to_rollback
=
i
+
1
;
}
}
vfree
(
clone_sources_tmp
);
k
vfree
(
clone_sources_tmp
);
clone_sources_tmp
=
NULL
;
clone_sources_tmp
=
NULL
;
}
}
...
@@ -6224,7 +6227,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
...
@@ -6224,7 +6227,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
btrfs_root_dec_send_in_progress
(
sctx
->
parent_root
);
btrfs_root_dec_send_in_progress
(
sctx
->
parent_root
);
kfree
(
arg
);
kfree
(
arg
);
vfree
(
clone_sources_tmp
);
k
vfree
(
clone_sources_tmp
);
if
(
sctx
)
{
if
(
sctx
)
{
if
(
sctx
->
send_filp
)
if
(
sctx
->
send_filp
)
...
...
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