summaryrefslogtreecommitdiffstats
path: root/utils/exportfs/exportfs.c
diff options
context:
space:
mode:
authorRobert Schiele <rschiele@gmail.com>2013-11-05 14:21:47 -0500
committerSteve Dickson <steved@redhat.com>2013-11-05 14:21:47 -0500
commit07280569e08f5810cd586c594ea257840609099b (patch)
treea527e4a69a1fef78ae841b26e919161b97a38cbb /utils/exportfs/exportfs.c
parentff948a50ef1013d7caa5d66e5534f69a94ec1c88 (diff)
downloadnfs-utils-07280569e08f5810cd586c594ea257840609099b.tar.gz
nfs-utils-07280569e08f5810cd586c594ea257840609099b.tar.xz
nfs-utils-07280569e08f5810cd586c594ea257840609099b.zip
statd: fix race condition for parallel startup of statd
When start_statd figures out that statd is not yet running it starts it, waits for the invoked process to complete, and finally verifies that statd is working. This approach works for serially mounting NFS file systems but has a race condition for parallel mounting. In the parallel case it can happen that two mount commands A and B both decide that statd needs to be started. Both of them try to start statd. Obviously only one of them can successfully do so, let's assume this is command A in our case. The statd invoked by B terminates because the resource is already claimed by the statd invoked by A. The termination of B's statd though is before the statd of A has completely set up all things. This causes the check for a working statd of command B to fail and terminate the mount request with an error. To prevent this we define a timeout value. In case the initial check after invoking statd fails we try again in a loop 10 times a second until the timeout is reached. In our tests when the race occurred we typically were successful already on the first retry within the loop. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/exportfs/exportfs.c')
0 files changed, 0 insertions, 0 deletions