diff options
author | Anand Avati <avati@redhat.com> | 2013-04-03 16:31:07 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-05-07 11:54:33 -0700 |
commit | 5ac55756cd923e4bb1e5b5df50aeaf198d5531b7 (patch) | |
tree | 24b00ec6b985ad9a4caf8253d8d55eb491356931 /xlators/lib | |
parent | f00720f3ed760f018d8c847476563a5eb1b111a3 (diff) |
posix: fix dangerous "sharing" of fd in readdir between two requestsv3.4.0beta1
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 <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4774
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/4963
Diffstat (limited to 'xlators/lib')
0 files changed, 0 insertions, 0 deletions