Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug report: ceph: && vs ||

2 views
Skip to first unread message

Dan Carpenter

unread,
Mar 20, 2010, 8:50:02 AM3/20/10
to

1772 /* correct session? */
1773 if (!req->r_session && req->r_session != session) {

Is this supposed to || here? We know "session" is non-NULL at
the point because we already dereferenced it. If "req->r_session"
is null then the second condition is always true.

Also we dereference "req->r_session" later on without checking.

1774 pr_err("mdsc_handle_reply got %llu on session mds%d"
1775 " not mds%d\n", tid, session->s_mds,
1776 req->r_session ? req->r_session->s_mds : -1);
1777 mutex_unlock(&mdsc->mutex);
1778 goto out;
1779 }
1780

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Sage Weil

unread,
Mar 21, 2010, 12:00:02 AM3/21/10
to
On Sat, 20 Mar 2010, Dan Carpenter wrote:
>
>
> 1772 /* correct session? */
> 1773 if (!req->r_session && req->r_session != session) {
>
> Is this supposed to || here? We know "session" is non-NULL at
> the point because we already dereferenced it. If "req->r_session"
> is null then the second condition is always true.
>
> Also we dereference "req->r_session" later on without checking.

Yeah, that check is clearly wrong. A

if (req->r_session != session) {

is sufficient because the passed session is always non-NULL. Applied a
fix.

Thanks-
sage

0 new messages