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
7ec7b94a
Commit
7ec7b94a
authored
Apr 07, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blkdev_write_iter: expand generic_file_checks() call in there
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5f380c7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
fs/block_dev.c
fs/block_dev.c
+9
-6
No files found.
fs/block_dev.c
View file @
7ec7b94a
...
@@ -1595,18 +1595,21 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
...
@@ -1595,18 +1595,21 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
ssize_t
blkdev_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
ssize_t
blkdev_write_iter
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
from
)
{
{
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
inode
*
bd_inode
=
file
->
f_mapping
->
host
;
loff_t
size
=
i_size_read
(
bd_inode
);
struct
blk_plug
plug
;
struct
blk_plug
plug
;
ssize_t
ret
;
ssize_t
ret
;
size_t
count
=
iov_iter_count
(
from
);
ret
=
generic_write_checks
(
file
,
&
iocb
->
ki_pos
,
&
count
,
1
);
if
(
bdev_read_only
(
I_BDEV
(
bd_inode
)))
if
(
ret
)
return
-
EPERM
;
return
ret
;
if
(
count
==
0
)
if
(
!
iov_iter_count
(
from
)
)
return
0
;
return
0
;
iov_iter_truncate
(
from
,
count
);
if
(
iocb
->
ki_pos
>=
size
)
return
-
ENOSPC
;
iov_iter_truncate
(
from
,
size
-
iocb
->
ki_pos
);
blk_start_plug
(
&
plug
);
blk_start_plug
(
&
plug
);
ret
=
__generic_file_write_iter
(
iocb
,
from
);
ret
=
__generic_file_write_iter
(
iocb
,
from
);
...
...
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