From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755052AbYI1Pya (ORCPT ); Sun, 28 Sep 2008 11:54:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753378AbYI1PvM (ORCPT ); Sun, 28 Sep 2008 11:51:12 -0400 Received: from mail-gx0-f16.google.com ([209.85.217.16]:47042 "EHLO mail-gx0-f16.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754489AbYI1PvL (ORCPT ); Sun, 28 Sep 2008 11:51:11 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=J/2ooLp3K5lw3jPVsz1Kdyg0DOjlQeBZsHhzPI7+XdY8FgGVO2dr25yeOByNNBUMkV UUJtQRTo0++F0Ddlgv+WN6FhOnrDTfBKakhe1urewKs5q9Sqz2KVHVXZSHXdWg3U7OSP avNc0fUS8hQaI/bA7nrwM1JYix9T5jRlqCtAU= Message-ID: Date: Sun, 28 Sep 2008 17:51:07 +0200 From: "Leon Woestenberg" To: "Boaz Harrosh" , "linux-kernel@vger.kernel.org" Subject: Re: scatterlist.c: bug in sg_next()? In-Reply-To: <48DFA285.1010701@panasas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48DFA285.1010701@panasas.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sun, Sep 28, 2008 at 5:28 PM, Boaz Harrosh wrote: > Leon Woestenberg wrote: >> In sg_next(), after following a chain_ptr, a few more checks should be >> performed. >> The rare case exists that the first entry in the chained list is a >> last marker, in case NULL must be returned. > > No! the last marker is set on a valid sg entry. Only it's next > is no longer valid. So the check at the top is for the Next-sg > not the passed-in-sg. What you thought of is a NULL terminating > sg-list. The end marker is so to save the extra NULL entry. > Ah yes, the lower bit magic. Thanks! Sorry for the noise. Regards, -- Leon