Bug 8836 - aio_fork segfaults on "smbcontrol close-share"
Summary: aio_fork segfaults on "smbcontrol close-share"
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2012-04-02 07:36 UTC by Volker Lendecke
Modified: 2012-04-10 18:49 UTC (History)
0 users

See Also:

Patch from master (3.97 KB, patch)
2012-04-02 07:36 UTC, Volker Lendecke
jra: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Lendecke 2012-04-02 07:36:10 UTC
Created attachment 7415 [details]
Patch from master

From the commit msg:

    s3-aio-fork: Fix a segfault in vfs_aio_fork
    aio_suspend does not signal the main process with a signal, it just waits. The
    aio_fork module does not use the signal at all, it directly calls back into the
    main smbd by calling smbd_aio_complete_aio_ex. This is an abstraction
    violation, but the alternative would have been to use signals where they are
    not needed. However, in wait_for_aio_completion this bites us: With aio_fork we
    call handle_aio_completed twice on the same aio_ex struct: Once from the call
    to handle_aio_completion within the aio_fork module and once from the code in
    This patch fixes it in a pretty bad way by introducing flag variables and more
    state. But the mid-term plan is to replace the posix aio calls from the vfs and
    do pread_send/recv and pwrite_send/recv at the vfs layer, so this will
    significantly change anyway.
    Thanks to Kirill Malkin <kirill.malkin@starboardstorage.com> for reporting this
Comment 1 Volker Lendecke 2012-04-02 18:35:02 UTC
Kirill confirmed the patch fixes the issue for him.
Comment 2 Jeremy Allison 2012-04-02 19:01:42 UTC
Comment on attachment 7415 [details]
Patch from master

Looks good to me for 3.6.next.
Comment 3 Jeremy Allison 2012-04-02 19:02:02 UTC
Re-assigning to Karolin for inclusion in 3.6.next.
Comment 4 Karolin Seeger 2012-04-10 18:49:49 UTC
Pushed to v3-6-test.
Closing out bug report.