tsocket: writev can return -1, with an errno==ENOMEM on Solaris/illumos.

David Collier-Brown davec-b at rogers.com
Thu Mar 14 11:42:41 MDT 2013


On 03/13/2013 05:32 PM, Ira Cooper wrote:
> Patches are up.  Exactly the same as what you've got.
>
> -Ira
>
>
> On Wed, Mar 13, 2013 at 5:14 PM, Ira Cooper <ira at samba.org> wrote:
>
>> Bug #9716.
>>
>> I'll get patches up either tonight or tomorrow.
>>
>> -Ira
>>
>>
>> On Wed, Mar 13, 2013 at 5:04 PM, Jeremy Allison <jra at samba.org> wrote:
>>
>>> On Wed, Mar 13, 2013 at 09:50:57AM -0400, Ira Cooper wrote:
>>>> Before you ask:
>>>>
>>>> Yes, I looked at the illumos kernel sources, and I proved that this
>>>> happened using dtrace.
>>>>
>>>> It is a strange case, but the actual strange errno will only come from
>>> the
>>>> network stack as far as I can tell.
>>>>
>>>> For solaris users pushing high amounts of SMB2 traffic.  This is a
>>> fairly
>>>> important fix, the way the error manifests can be VERY hard to track
>>> down,
>>>> and will show up as samba just being unreliable.  (Randomly closing
>>>> connections.)
>>>>
>>>> Please review and push if acceptable, after that I'll create the bug
>>> and we
>>>> can backport it to 4.0 and 3.6.
>>>>
>>>> Note: I did my work against 3.6.  This is a "forward port" of that work.
>>> LGTM. Pushed to autobuild.
>>>
>>> Can you log the bug so we can get it fixed in 4.0.x and 3.6.x ?
>>>
>>> Thanks,
>>>
>>> Jeremy.
>>>
>>
We used to run into errno extensions and critical orderings back when I
was on the Sun ABI team: in my opinion, the real meaning of errno is
that an error was encountered which may require handling in the caller.

The classic one (circa v6) was an interrupted system call, which require
the caller to repeat the call at least once, and optionally a bounded
number of times.  Evil!

Over time, the community reduced the number of special cases which would
require such an action in user-space, to the point that  now I would
recommend that one never "switch on errno" in a normal program.  Alas, a
program, like Samba, that has to provide a reliable service on top of
not-so-reliable underpinnings may have to break that rule...  but I'd
look hard for a way to follow the rule (;-))

Consider what kind of strange program would require a language construct
like

    try {
        doSomething(x,y,z);
    } catch (oopsie) {
        retry no more than 3 times;
    } catch (everything else) {
        dumpCore();
    }


-- 
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net           |                      -- Mark Twain
(416) 223-8968



More information about the samba-technical mailing list