[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: fsfs's fs_serialized_init() not thread safe?

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 10 Jan 2011 07:20:57 +0200

Blair Zajac wrote on Sun, Jan 09, 2011 at 12:09:34 -0800:
> Wanted to confirm a reading of fs_serialized_init() in libsvn_fs_fs/fs.c
> in a persistent, multithreaded server.
>
> It appears that if fs_serialized_init() is called at the same time by two
> or more threads,

Can this happen?

fs_serialized_init() is called from a number of places; checking the
first two --- fs_open() and fs_create() --- I see that
libsvn_fs/fs-loader.c grabs a mutex before calling the
fs_library_vtable_t->{create,open_fs}() functions.

I didn't check the other callers.

> then you would have a race on apr_pool_userdata_get()
> and apr_pool_userdata_set().
>
> It looks like a good fix for this would be to have svn_fs_initialize()
> call down into the fs implementation library to set this up? Would that
> be a good solution to this? It would need to call into all fs
> implementation libraries though, loading a .so that may never be used.
>
> Blair
>
Received on 2011-01-10 06:24:35 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.