liyinshu has uploaded this change for review. (
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/542082 )
Change subject: Fix crash bcz slot->cached_result is null for replay request
......................................................................
Fix crash bcz slot->cached_result is null for replay request
Reproduce crash as follows:
thread1: receive a replay request, and found slot->cached_result not null,
assign slot to data->slot at nfs4_op_sequence.c:131, and unlock
the slot->lock.
thread2: receive a normal request, got slot->lock and release_slot(slot),
so slot->cached_result was set null.
thread1: in complete_op, assign *status with
data->slot->cached_result->status,
but data->slot->cached_result is null, so crash happens.
To fix crash, add pointer cached_result in compound_data, and save
slot->cached_result when found request replayed, in complete_op, get
cached_result from compound_data. Even though, other thread release slot
and set slot->cached_result with null, we can still get cacehd_result
from compound_data.
Change-Id: I92f472edc773bf357b35da1a1805e2d59c95a286
Signed-off-by: liyinshu <liyinshu(a)bytedance.com>
---
M src/Protocols/NFS/nfs4_Compound.c
M src/Protocols/NFS/nfs4_op_sequence.c
M src/include/nfs_proto_data.h
3 files changed, 41 insertions(+), 2 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/82/542082/1
--
To view, visit
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/542082
To unsubscribe, or for help writing mail filters, visit
https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I92f472edc773bf357b35da1a1805e2d59c95a286
Gerrit-Change-Number: 542082
Gerrit-PatchSet: 1
Gerrit-Owner: liyinshu <liyinshu(a)bytedance.com>
Gerrit-MessageType: newchange