Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: isn't __brelse() wrong? | Date | 3 Mar 2000 16:46:15 -0800 |
| |
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/
| |