Linux-kernel mailing list archive 1999-36,: Bug in __bforget()?

# Bug in __bforget()?

Jan Kara (jack@atrey.karlin.mff.cuni.cz)
Sat, 11 Sep 1999 20:25:08 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jan Kara: "Re: Quota speedup in 2.2.12 and bugfix"
- Previous message: Nick Holloway: "Patch for 2.3.18 to ignore bogus APM error codes"

Hello.

While reading buffer cache code I found one thing which I didn't understand.
In __bforget() there is a test whether buffer head is in use or is locked.
The test looks like:
if (!atomic_dec_and_test(&buf->b_count) || buffer_locked(buf))
goto in_use;
But I think it should be:
if (atomic_dec_and_test(&buf->b_count)...))
goto in_use;
Because buffer is in use when it has b_count > 0 and now whne b_count == 0.
Am I missing something?

Honza.

-
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/

- Next message: Jan Kara: "Re: Quota speedup in 2.2.12 and bugfix"
- Previous message: Nick Holloway: "Patch for 2.3.18 to ignore bogus APM error codes"