Skip to content

Commit 0866004

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFSv3: Ensure that do_proc_get_root() reports errors correctly
If the rpc call to NFS3PROC_FSINFO fails, then we need to report that error so that the mount fails. Otherwise we can end up with a superblock with completely unusable values for block sizes, maxfilesize, etc. Reported-by: Yuanming Chen <[email protected]> Cc: [email protected] Signed-off-by: Trond Myklebust <[email protected]>
1 parent 7653f6f commit 0866004

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs3proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ do_proc_get_root(struct rpc_clnt *client, struct nfs_fh *fhandle,
6969
nfs_fattr_init(info->fattr);
7070
status = rpc_call_sync(client, &msg, 0);
7171
dprintk("%s: reply fsinfo: %d\n", __func__, status);
72-
if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
72+
if (status == 0 && !(info->fattr->valid & NFS_ATTR_FATTR)) {
7373
msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
7474
msg.rpc_resp = info->fattr;
7575
status = rpc_call_sync(client, &msg, 0);

0 commit comments

Comments
 (0)