Lior Suliman has uploaded this change for review.

View Change

FSAL_MDCACHE/mdcache_handle: Fixed rename to compare the old and new directory handles and names and not only the source and destination handles

This fixes a Time-of-check Time-of-use bug checking for the file handle of the source before moving
and then the file handle of the target before moving and comparing them.
There can be a scenario that two or more clients will perform the rename at the same time
both will pass the source lookup and one of them will perform the move while the other can get a success for it as well.
This damaged the atomicity of the rename operation.
The FSAL should handle the case when those are different entries with the same file handle (hard-links).

Change-Id: I70bcfa28e9369c52d6b1385ac70eed20fc07f48d
Signed-off-by: Lior Suliman <liorsu@google.com>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
1 file changed, 6 insertions(+), 1 deletion(-)

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

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

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I70bcfa28e9369c52d6b1385ac70eed20fc07f48d
Gerrit-Change-Number: 555852
Gerrit-PatchSet: 1
Gerrit-Owner: Lior Suliman <liorsu@gmail.com>
Gerrit-MessageType: newchange