>From Daniel Gryniewicz <d...@redhat.com>:

Daniel Gryniewicz has uploaded a new change for review. ( 
https://review.gerrithub.io/351383


Change subject: Reduce and mitigate a rename/readir race window
......................................................................

Reduce and mitigate a rename/readir race window

There is a race window in rename() with readdir().  This steps are this:
mdcache_rename() calls the sub-FSAL rename(), which does the actual
rename.  Then, it locks the src and dst dirs, and renames the dirent.
However, between the real rename and the dirent rename, another client
may have come in and done a readdir(), refreshing the dirent cache.  The
lookup on the old dirent then fails, returning ENOENT to  the client.

Reduce this race window, by moving the locking to immediately after the
rename.  This should also make it much less likely that the dirents are
refreshed, since we haven't marked them stale yet.

In addition, handle ENOENT on the src dirent as an indication that this
race has occured, and do not treat it as a user-visible error.

RH Bug #1428798

Change-Id: I9a7e706b25a8a2f1df54a982b2952aad7134a89d
Signed-off-by: Daniel Gryniewicz <d...@redhat.com>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
1 file changed, 10 insertions(+), 3 deletions(-)



  git pull ssh://review.gerrithub.io:29419/ffilz/nfs-ganesha 
refs/changes/83/351383/1
-- 
To view, visit https://review.gerrithub.io/351383
To unsubscribe, visit https://review.gerrithub.io/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a7e706b25a8a2f1df54a982b2952aad7134a89d
Gerrit-Change-Number: 351383
Gerrit-PatchSet: 1
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Owner: Daniel Gryniewicz <d...@redhat.com>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to