Re: [Patch 2/7] tabled: fix the endless recusion when reading long objects

Jeff Garzik <[email protected]>
Newsgroups org.kernel.vger.hail-devel
Message-ID <[email protected]>
On 04/01/2010 09:51 PM, Pete Zaitcev wrote:
> At certain network and disk speeds, tabled can blow its stack by
> filling it with (essentially) endless recursion:
>
> #2  0x000000000040c077 in cli_write_free (cli=<value optimized out>, tmp=
>      0x7bb910, done=<value optimized out>) at server.c:397
> #3  0x000000000040ca55 in cli_writable (cli=0x686e90) at server.c:525
> #4  0x000000000040da65 in cli_write_start (cli=0x686e90) at server.c:561
> #5  0x0000000000408ad5 in object_get_poke (cli=0x686e90) at object.c:1039
> #6  0x000000000040c077 in cli_write_free (cli=<value optimized out>, tmp=
>      0x7bb8d0, done=<value optimized out>) at server.c:397
> #7  0x000000000040ca55 in cli_writable (cli=0x686e90) at server.c:525
> #8  0x000000000040da65 in cli_write_start (cli=0x686e90) at server.c:561
> #9  0x0000000000408ad5 in object_get_poke (cli=0x686e90) at object.c:1039
> #10 0x000000000040c077 in cli_write_free (cli=<value optimized out>, tmp=
>      0x7bb890, done=<value optimized out>) at server.c:397
>
> The fix is to deliver callbacks only from the top level.
>
> Callbacks must be delivered every time a send is completed,
> which amounts to every call to is_writeable(). Since there
> is a large number of callers to it, we found it advantageous
> to run callbacks from every source of events. In other words,
> every function that is passed to event_set must invoke
> cli_write_run_compl. Mind that storage.c contains calls to
> event_set.
>
> Signed-off-by: Pete Zaitcev<[email protected]>
>
> ---
>   server/object.c |    4 +++
>   server/server.c |   52 +++++++++++++++++++++++++++++++++++-----------
>   server/tabled.h |    6 +++++
>   3 files changed, 50 insertions(+), 12 deletions(-)

applied 2-7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.