Skip to content

Commit 4506f23

Browse files
olgakorn1amschuma-ntap
authored andcommitted
NFSv4.1: fix zero value filehandle in post open getattr
Currently, if the OPEN compound experiencing an error and needs to get the file attributes separately, it will send a stand alone GETATTR but it would use the filehandle from the results of the OPEN compound. In case of the CLAIM_FH OPEN, nfs_openres's fh is zero value. That generate a GETATTR that's sent with a zero value filehandle, and results in the server returning an error. Instead, for the CLAIM_FH OPEN, take the filehandle that was used in the PUTFH of the OPEN compound. Signed-off-by: Olga Kornievskaia <[email protected]> Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 806a3bc commit 4506f23

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/nfs/nfs4proc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,8 +2703,12 @@ static int _nfs4_proc_open(struct nfs4_opendata *data,
27032703
return status;
27042704
}
27052705
if (!(o_res->f_attr->valid & NFS_ATTR_FATTR)) {
2706+
struct nfs_fh *fh = &o_res->fh;
2707+
27062708
nfs4_sequence_free_slot(&o_res->seq_res);
2707-
nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr, NULL);
2709+
if (o_arg->claim == NFS4_OPEN_CLAIM_FH)
2710+
fh = NFS_FH(d_inode(data->dentry));
2711+
nfs4_proc_getattr(server, fh, o_res->f_attr, NULL);
27082712
}
27092713
return 0;
27102714
}

0 commit comments

Comments
 (0)