roybabayov@gmail.com has uploaded this change for review.

View Change

Don't keep READ replies in the NFSv4.1 reply cache

- A READ reply hands its data buffer to the transport, which frees it
once the reply is sent, but the slot reply cache still points to it.
- So replaying a READ request that asked to be cached (sa_cachethis)
sends freed heap memory and frees the buffer again.
- Return NFS4ERR_REP_TOO_BIG_TO_CACHE (the RFC 8881 error for a reply
the server can't cache) for READ and READ_PLUS in such requests.
- The Linux client never asks to cache READ or READ_PLUS replies, so it
isn't affected.

Change-Id: I9452f58a5f7739138d4aa06c7f49f3843b65d7b7
Signed-off-by: Roy Babayov <roybabayov@google.com>
---
M src/Protocols/NFS/nfs4_op_read.c
1 file changed, 18 insertions(+), 0 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/50/1259050/1

To view, visit change 1259050. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I9452f58a5f7739138d4aa06c7f49f3843b65d7b7
Gerrit-Change-Number: 1259050
Gerrit-PatchSet: 1
Gerrit-Owner: roybabayov@gmail.com