>From Frank Filz <ffilz...@mindspring.com>: Frank Filz has uploaded a new change for review.
https://review.gerrithub.io/236426 Change subject: Use rwlock to protect FSAL_VFS file descriptor ...................................................................... Use rwlock to protect FSAL_VFS file descriptor The lock is taken in write mode only for those functions that open or close the file descriptor. Other operations just need the read lock including those that call vfs_fsal_open_and_stat which either uses the existing file descriptor if it is in the right mode, or a temporary file descriptor. There is also a fix to setattrs that should eliminate the need for re-opening and re-trying ftruncate, but in case it actually is still necessary, a FSAL_O_REOPEN flag has been added that forces vfs_fsal_open_and_stat to open a new temporary file descriptor. I suspect the problem that necessitated that code is that vfs_fsal_open_and_stat would re-use any existing file descriptor including a read-only one. The FSAL_O_ANY flag allows vfs_fsal_open_and_stat to re-use any existing open file descriptor, and if one is not open, the flag converts into O_RDONLY for opening a temporary file descriptor. Change-Id: Idde408e4eae230e5208c7c784940d71098eead2b Signed-off-by: Frank S. Filz <ffilz...@mindspring.com> --- M src/FSAL/FSAL_VFS/file.c M src/FSAL/FSAL_VFS/handle.c M src/FSAL/FSAL_VFS/panfs/mds.c M src/FSAL/fsal_convert.c M src/include/fsal_types.h 5 files changed, 183 insertions(+), 40 deletions(-) git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/26/236426/1 -- To view, visit https://review.gerrithub.io/236426 To unsubscribe, visit https://review.gerrithub.io/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idde408e4eae230e5208c7c784940d71098eead2b Gerrit-PatchSet: 1 Gerrit-Project: ffilz/nfs-ganesha Gerrit-Branch: next Gerrit-Owner: Frank Filz <ffilz...@mindspring.com> ------------------------------------------------------------------------------ _______________________________________________ Nfs-ganesha-devel mailing list Nfs-ganesha-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel