Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2010 23:29:38 -0300
From:      "Carlos A. M. dos Santos" <unixmania@gmail.com>
To:        Brian Somers <brian@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kirk McKusick <mckusick@freebsd.org>
Subject:   Re: svn commit: r212617 - head/sys/ufs/ffs
Message-ID:  <AANLkTikU6L8sjWi6cSWzK2wJqj7VAm5DSZ-YhQcZ49mP@mail.gmail.com>
In-Reply-To: <20100916014404.0409017f@dev.lan.Awfulhak.org>
References:  <201009141804.o8EI45kp088466@svn.freebsd.org> <20100916014404.0409017f@dev.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, Sep 16, 2010 at 5:44 AM, Brian Somers <brian@freebsd.org> wrote:
> On Tue, 14 Sep 2010 18:04:05 +0000 (UTC) Kirk McKusick <mckusick@FreeBSD.org> wrote:
>> Author: mckusick
>> Date: Tue Sep 14 18:04:05 2010
>> New Revision: 212617
>> URL: http://svn.freebsd.org/changeset/base/212617
>>
>> Log:
>>   Update comments in soft updates code to more fully describe
>>   the addition of journalling. Only functional change is to
>>   tighten a KASSERT.
>>
>>   Reviewed by:        jeff Roberson
>>
>> Modified:
>>   head/sys/ufs/ffs/ffs_softdep.c
>>   head/sys/ufs/ffs/fs.h
>>   head/sys/ufs/ffs/softdep.h
>>
>> Modified: head/sys/ufs/ffs/ffs_softdep.c
>> ==============================================================================
>> --- head/sys/ufs/ffs/ffs_softdep.c    Tue Sep 14 17:22:06 2010        (r212616)
>> +++ head/sys/ufs/ffs/ffs_softdep.c    Tue Sep 14 18:04:05 2010        (r212617)
>> @@ -2378,7 +2378,8 @@ remove_from_journal(wk)
>>       /*
>>        * We emulate a TAILQ to save space in most structures which do not
>>        * require TAILQ semantics.  Here we must update the tail position
>> -      * when removing the tail which is not the final entry.
>> +      * when removing the tail which is not the final entry. This works
>> +      * only if the worklist linkage are at the beginning of the structure.
>>        */
>>       if (ump->softdep_journal_tail == wk)
>>               ump->softdep_journal_tail =
>> @@ -2605,7 +2606,7 @@ jremref_write(jremref, jseg, data)
>>       inoref_write(&jremref->jr_ref, jseg, rec);
>>  }
>>
>> -static       void
>> +static void
>>  jmvref_write(jmvref, jseg, data)
>>       struct jmvref *jmvref;
>>       struct jseg *jseg;
>> @@ -2906,9 +2907,9 @@ complete_jseg(jseg)
>>               waiting = wk->wk_state & IOWAITING;
>>               wk->wk_state &= ~(IOSTARTED | IOWAITING);
>>               wk->wk_state |= COMPLETE;
>> -             KASSERT(i < jseg->js_cnt,
>> +             KASSERT(i++ < jseg->js_cnt,
>>                   ("handle_written_jseg: overflow %d >= %d",
> [.....]
>
> If INVARIANTS is not defined, the above i++ will not happen.

Which does not cause any harm, since "i" is a local variable, not used
anywhere else in the function. A picky compiler would complain,
however, that the variable is never read.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikU6L8sjWi6cSWzK2wJqj7VAm5DSZ-YhQcZ49mP>