lkml.org 
[lkml]   [2000]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: isn't __brelse() wrong?
Date
In article <Pine.SCO.3.94.1000303160209.5282D-100000@tyne.london.sco.com>,
Tigran Aivazian <tigran@sco.COM> wrote:
>Hi guys,
>
>This is just a comment in passing as I am looking at some other code, but
>a glance at __brelse() which looks like this:
>
> if (atomic_read(&buf->b_count)) {
> atomic_dec(&buf->b_count);
> return;
> }

This is not a correctness issue: a correct usage of b_count will NEVER
allow anybody to decrement to a negative value.

The test is a debugging test, and as such race conditions aren't the
issue: it's there not to catch a race, but to catch potentially buggy
users who brelse() more than they ever meant to ;)

I don't think it has caught anybody in the last few years, but it's
certainly cheap enough, so..

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.063 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site