Dave,

What is the matter with this picture?  Why is q being checked
for null _after_ checking for magic (which dereferences q) and
taking locks (which dereferences q)?  The LOG will never execute.
The kernel will hit a page 0 kernel oops before it gets there.

in LiS/head/safe.c:

void lis_safe_noenable(queue_t * q, char *f, int l)
{
        int psw;
        if (!lis_check_q_magic(q, f, l))
                return;
        LIS_QISRLOCK(q, &psw);
        if (q == NULL)
                LOG(f, l, "NULL q in noenable");
        else
                q->q_flag |= QNOENB;
        LIS_QISRUNLOCK(q, &psw);
}

void lis_safe_enableok(queue_t * q, char *f, int l)
{
        int psw;
        if (!lis_check_q_magic(q, f, l))
                return;
        LIS_QISRLOCK(q, &psw);
        if (q == NULL)
                LOG(f, l, "NULL q in enableok");
        else
                q->q_flag &= ~QNOENB;
        LIS_QISRUNLOCK(q, &psw);
}

I think you meant:

void lis_safe_noenable(queue_t * q, char *f, int l)
{
        int psw;
        if (q != NULL) {
                LOG(f, l, "NULL q in noenable");
                return;
        }
        if (!lis_check_q_magic(q, f, l))
                return;
        LIS_QISRLOCK(q, &psw);
        q->q_flag |= QNOENB;
        LIS_QISRUNLOCK(q, &psw);
}

void lis_safe_enableok(queue_t * q, char *f, int l)
{
        int psw;
        if (q == NULL) {
                LOG(f, l, "NULL q in enableok");
                return;
        }
        if (!lis_check_q_magic(q, f, l))
                return;
        LIS_QISRLOCK(q, &psw);
        q->q_flag &= ~QNOENB;
        LIS_QISRUNLOCK(q, &psw);
}

I have a whole bunch more of these.  Do you want to see them?

--brian

-- 
Brian F. G. Bidulock    � The reasonable man adapts himself to the �
[EMAIL PROTECTED]    � world; the unreasonable one persists in  �
http://www.openss7.org/ � trying  to adapt the  world  to himself. �
                        � Therefore  all  progress  depends on the �
                        � unreasonable man. -- George Bernard Shaw �

_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to