path: root/xlators/cluster/afr/src/afr-dir-write.c
diff options
authorAnand Avati <>2013-04-03 16:31:07 -0700
committerAnand Avati <>2013-04-03 23:02:39 -0700
commit5cdd09c3087e7f0581392dd06d4a1d587176abcb (patch)
tree811f2e91bc11d2971f54a9507c2bbe0811fe5335 /xlators/cluster/afr/src/afr-dir-write.c
parent4e00f0017d7a3f77cb8c753b665352e25a33e1fa (diff)
posix: fix dangerous "sharing" of fd in readdir between two requests
posix_fill_readdir() is a multi-step function which performs many readdir() calls, and expects the directory cursor to have not "seeked away" elsewhere between two successive iterations. Usually this is not a problem as each opendir() from an application has its own backend fd, and there is nobody else to "seek away" the directory cursor. However in case of NFS's use of anonymous fd, the same fd_t is shared between all NFS readdir requests, and two readdir loops can be executing in parallel on the same dir dragging away the cursor in a chaotic manner. The fix in this patch is to lock on the fd around the loop. Another approach could be to reimplement posix_fill_readdir() with a single getdents() call, but that's for another day. Change-Id: Ia42e9c7fbcde43af4c0d08c20cc0f7419b98bd3f BUG: 948086 Signed-off-by: Anand Avati <> Reviewed-on: Reviewed-by: Jeff Darcy <> Tested-by: Gluster Build System <>
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-write.c')
0 files changed, 0 insertions, 0 deletions