Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux-guf
Manage
Activity
Members
Labels
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SECO Northern Europe
Kernel
linux-guf
Commits
65a4a1ca
Commit
65a4a1ca
authored
9 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
nfs: generic_write_checks() shouldn't be done on swapout...
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7da839c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fs/nfs/direct.c
+3
-9
3 additions, 9 deletions
fs/nfs/direct.c
fs/nfs/file.c
+7
-4
7 additions, 4 deletions
fs/nfs/file.c
include/linux/nfs_fs.h
+1
-2
1 addition, 2 deletions
include/linux/nfs_fs.h
with
11 additions
and
15 deletions
fs/nfs/direct.c
+
3
−
9
View file @
65a4a1ca
...
@@ -268,7 +268,7 @@ ssize_t nfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
...
@@ -268,7 +268,7 @@ ssize_t nfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
if
(
iov_iter_rw
(
iter
)
==
READ
)
if
(
iov_iter_rw
(
iter
)
==
READ
)
return
nfs_file_direct_read
(
iocb
,
iter
,
pos
);
return
nfs_file_direct_read
(
iocb
,
iter
,
pos
);
return
nfs_file_direct_write
(
iocb
,
iter
,
pos
);
return
nfs_file_direct_write
(
iocb
,
iter
);
#endif
/* CONFIG_NFS_SWAP */
#endif
/* CONFIG_NFS_SWAP */
}
}
...
@@ -959,8 +959,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
...
@@ -959,8 +959,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
* Note that O_APPEND is not supported for NFS direct writes, as there
* Note that O_APPEND is not supported for NFS direct writes, as there
* is no atomic O_APPEND write facility in the NFS protocol.
* is no atomic O_APPEND write facility in the NFS protocol.
*/
*/
ssize_t
nfs_file_direct_write
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
,
ssize_t
nfs_file_direct_write
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
)
loff_t
pos
)
{
{
ssize_t
result
=
-
EINVAL
;
ssize_t
result
=
-
EINVAL
;
struct
file
*
file
=
iocb
->
ki_filp
;
struct
file
*
file
=
iocb
->
ki_filp
;
...
@@ -968,15 +967,11 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
...
@@ -968,15 +967,11 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
struct
inode
*
inode
=
mapping
->
host
;
struct
inode
*
inode
=
mapping
->
host
;
struct
nfs_direct_req
*
dreq
;
struct
nfs_direct_req
*
dreq
;
struct
nfs_lock_context
*
l_ctx
;
struct
nfs_lock_context
*
l_ctx
;
loff_t
end
;
loff_t
pos
,
end
;
dfprintk
(
FILE
,
"NFS: direct write(%pD2, %zd@%Ld)
\n
"
,
dfprintk
(
FILE
,
"NFS: direct write(%pD2, %zd@%Ld)
\n
"
,
file
,
iov_iter_count
(
iter
),
(
long
long
)
iocb
->
ki_pos
);
file
,
iov_iter_count
(
iter
),
(
long
long
)
iocb
->
ki_pos
);
result
=
generic_write_checks
(
iocb
,
iter
);
if
(
result
<=
0
)
goto
out
;
nfs_add_stats
(
mapping
->
host
,
NFSIOS_DIRECTWRITTENBYTES
,
nfs_add_stats
(
mapping
->
host
,
NFSIOS_DIRECTWRITTENBYTES
,
iov_iter_count
(
iter
));
iov_iter_count
(
iter
));
...
@@ -1044,7 +1039,6 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
...
@@ -1044,7 +1039,6 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
nfs_direct_req_release
(
dreq
);
nfs_direct_req_release
(
dreq
);
out_unlock:
out_unlock:
mutex_unlock
(
&
inode
->
i_mutex
);
mutex_unlock
(
&
inode
->
i_mutex
);
out:
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
fs/nfs/file.c
+
7
−
4
View file @
65a4a1ca
...
@@ -674,17 +674,20 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
...
@@ -674,17 +674,20 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
unsigned
long
written
=
0
;
unsigned
long
written
=
0
;
ssize_t
result
;
ssize_t
result
;
size_t
count
=
iov_iter_count
(
from
);
size_t
count
=
iov_iter_count
(
from
);
loff_t
pos
=
iocb
->
ki_pos
;
result
=
nfs_key_timeout_notify
(
file
,
inode
);
result
=
nfs_key_timeout_notify
(
file
,
inode
);
if
(
result
)
if
(
result
)
return
result
;
return
result
;
if
(
iocb
->
ki_flags
&
IOCB_DIRECT
)
if
(
iocb
->
ki_flags
&
IOCB_DIRECT
)
{
return
nfs_file_direct_write
(
iocb
,
from
,
pos
);
result
=
generic_write_checks
(
iocb
,
from
);
if
(
result
<=
0
)
return
result
;
return
nfs_file_direct_write
(
iocb
,
from
);
}
dprintk
(
"NFS: write(%pD2, %zu@%Ld)
\n
"
,
dprintk
(
"NFS: write(%pD2, %zu@%Ld)
\n
"
,
file
,
count
,
(
long
long
)
pos
);
file
,
count
,
(
long
long
)
iocb
->
ki_
pos
);
result
=
-
EBUSY
;
result
=
-
EBUSY
;
if
(
IS_SWAPFILE
(
inode
))
if
(
IS_SWAPFILE
(
inode
))
...
...
This diff is collapsed.
Click to expand it.
include/linux/nfs_fs.h
+
1
−
2
View file @
65a4a1ca
...
@@ -452,8 +452,7 @@ extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
...
@@ -452,8 +452,7 @@ extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
struct
iov_iter
*
iter
,
struct
iov_iter
*
iter
,
loff_t
pos
);
loff_t
pos
);
extern
ssize_t
nfs_file_direct_write
(
struct
kiocb
*
iocb
,
extern
ssize_t
nfs_file_direct_write
(
struct
kiocb
*
iocb
,
struct
iov_iter
*
iter
,
struct
iov_iter
*
iter
);
loff_t
pos
);
/*
/*
* linux/fs/nfs/dir.c
* linux/fs/nfs/dir.c
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment