Re: [PATCH 0/2 v4] nfs: return nfs4 compound header status on op header decoding error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-07-03 at 20:49 +0300, Benny Halevy wrote:
> Trond,  following our conversation during the Connectathon
> I reduced this patch as much as possible and restricted the
> use of the compound header status to cases where op_hdr
> decoding hit an error.
> 
> This is needed for nfs41 for graceful fallback when trying
> to mount a 4.0 server with 4.1.  In this case the server
> returns no ops and the hdr status is set to
> NFS4ERR_MINOR_VERS_MISMATCH.
> 
> Please consider these patches:
> 
> [PATCH 1/2] nfs: return nfs4 compound header status on op header decoding error

No, this patch doesn't look right either. If we overrun the end of the
reply buffer, then xdr_inline_decode() will return a NULL pointer, so
you should never hit the your (opnum != expected) case.

So given that your concern is primarily the case where nops==0, why
don't you just add that particular case to decode_compound_hdr?

IOW: something like


@@static int decode_compound_hdr(
	p += XDR_QUADLEN(hdr->taglen);
	READ32(hdr->nops);
+	if (hdr->nops < 1)
+		return nfs4_stat_to_errno(hdr->status);
	return 0;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux