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
8d2a4538
Commit
8d2a4538
authored
Mar 13, 2004
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv2: Fix up NFSv2 reads so that they report when the server returned a short
read due to EOF.
parent
b9315c75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
fs/nfs/proc.c
fs/nfs/proc.c
+14
-2
fs/nfs/read.c
fs/nfs/read.c
+4
-1
No files found.
fs/nfs/proc.c
View file @
8d2a4538
...
...
@@ -186,8 +186,14 @@ nfs_proc_read(struct nfs_read_data *rdata, struct file *filp)
msg
.
rpc_cred
=
nfs_cred
(
inode
,
filp
);
status
=
rpc_call_sync
(
NFS_CLIENT
(
inode
),
&
msg
,
flags
);
if
(
status
>=
0
)
if
(
status
>=
0
)
{
nfs_refresh_inode
(
inode
,
fattr
);
/* Emulate the eof flag, which isn't normally needed in NFSv2
* as it is guaranteed to always return the file attributes
*/
if
(
rdata
->
args
.
offset
+
rdata
->
args
.
count
>=
fattr
->
size
)
rdata
->
res
.
eof
=
1
;
}
dprintk
(
"NFS reply read: %d
\n
"
,
status
);
return
status
;
}
...
...
@@ -541,8 +547,14 @@ nfs_read_done(struct rpc_task *task)
{
struct
nfs_read_data
*
data
=
(
struct
nfs_read_data
*
)
task
->
tk_calldata
;
if
(
task
->
tk_status
>=
0
)
if
(
task
->
tk_status
>=
0
)
{
nfs_refresh_inode
(
data
->
inode
,
data
->
res
.
fattr
);
/* Emulate the eof flag, which isn't normally needed in NFSv2
* as it is guaranteed to always return the file attributes
*/
if
(
data
->
args
.
offset
+
data
->
args
.
count
>=
data
->
res
.
fattr
->
size
)
data
->
res
.
eof
=
1
;
}
nfs_readpage_result
(
task
);
}
...
...
fs/nfs/read.c
View file @
8d2a4538
...
...
@@ -121,7 +121,10 @@ nfs_readpage_sync(struct file *file, struct inode *inode, struct page *page)
}
count
-=
result
;
rdata
.
args
.
pgbase
+=
result
;
if
(
result
<
rdata
.
args
.
count
)
/* NFSv2ism */
/* Note: result == 0 should only happen if we're caching
* a write that extends the file and punches a hole.
*/
if
(
rdata
.
res
.
eof
!=
0
||
result
==
0
)
break
;
}
while
(
count
);
NFS_FLAGS
(
inode
)
|=
NFS_INO_INVALID_ATIME
;
...
...
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