mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.4.23-pre3] Possible bug in fs/buffer.c
@ 2003-09-08 15:15 Rolf Eike Beer
  2003-09-08 15:42 ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Rolf Eike Beer @ 2003-09-08 15:15 UTC (permalink / raw)
  To: linux-kernel

This is __put_unused_buffer_head from fs/buffer.c, lines 1156 to 1171:


static void __put_unused_buffer_head(struct buffer_head * bh)
{
	if (unlikely(buffer_attached(bh)))
		BUG();
	if (nr_unused_buffer_heads >= MAX_UNUSED_BUFFERS) {
		kmem_cache_free(bh_cachep, bh);
	} else {
		bh->b_dev = B_FREE;
===>		bh->b_blocknr = -1;		<===
		bh->b_this_page = NULL;

		nr_unused_buffer_heads++;
		bh->b_next_free = unused_list;
		unused_list = bh;
	}
}

In include/linux/fs.h "struct buffer_head" is defined this way:

struct buffer_head {
        /* First cache line: */
        struct buffer_head *b_next;     /* Hash queue list */
        unsigned long b_blocknr;        /* block number */
...

So this line (and line 1205, which is the same) is either ugly (and someone
meant ~0UL or something similar) or completely bogus. Same way in 
2.6.0-test4-bk10/fs/buffer.c, line 1031 (b_blocknr is a sector_t, which is an
unsigned long).

Comments?

Eike

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-09-09 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 15:15 [2.4.23-pre3] Possible bug in fs/buffer.c Rolf Eike Beer
2003-09-08 15:42 ` Andreas Schwab
2003-09-08 15:58   ` Alan Cox
2003-09-08 16:04     ` Andreas Schwab
2003-09-08 22:13       ` J.A. Magallon
2003-09-09  0:53       ` Alan Cox
2003-09-09 13:39         ` Rolf Eike Beer
2003-09-08 16:12     ` Rolf Eike Beer
2003-09-09  0:52       ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome