2002-11-12 17:50:24

by Andrew Morton

[permalink] [raw]
Subject: Re: [patch/2.4] ll_rw_blk stomping on bh state [Re: kernel BUG at journal.c:1732! (2.4.19)]

"Stephen C. Tweedie" wrote:
>
> if (maxsector < count || maxsector - count < sector) {
> /* Yecch */
> bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
>
> ...
>
> Folks, just which buffer flags do we want to preserve in this case?
>

Why do we want to clear any flags in there at all? To prevent
a storm of error messages from a buffer which has a silly block
number?

If so, how about setting a new state bit which causes subsequent
IO attempts to silently drop the IO on the floor?


2002-11-12 18:47:14

by Stephen C. Tweedie

[permalink] [raw]
Subject: Re: [patch/2.4] ll_rw_blk stomping on bh state [Re: kernel BUG at journal.c:1732! (2.4.19)]

Hi,

On Tue, Nov 12, 2002 at 09:57:05AM -0800, Andrew Morton wrote:
> "Stephen C. Tweedie" wrote:
> >
> > if (maxsector < count || maxsector - count < sector) {
> > /* Yecch */
> > bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
> > ...
> > Folks, just which buffer flags do we want to preserve in this case?

> Why do we want to clear any flags in there at all? To prevent
> a storm of error messages from a buffer which has a silly block
> number?

That's the only reason I can think of. Simply scrubbing all the state
bits is totally the wrong way of going about that, of course.

> If so, how about setting a new state bit which causes subsequent
> IO attempts to silently drop the IO on the floor?

The only problem I could think of there would be weird interactions
with LVM if somebody lvextends a volume and the buffer suddenly
becomes valid again. I can't bring myself to care about breaking that
situation. :-)

--Stephen

2002-11-15 17:33:35

by Stephen C. Tweedie

[permalink] [raw]
Subject: Re: [patch/2.4] ll_rw_blk stomping on bh state [Re: kernel BUG at journal.c:1732! (2.4.19)]

Hi,

On Tue, Nov 12, 2002 at 06:53:45PM +0000, Stephen C. Tweedie wrote:

> On Tue, Nov 12, 2002 at 09:57:05AM -0800, Andrew Morton wrote:
> > "Stephen C. Tweedie" wrote:
> > >
> > > if (maxsector < count || maxsector - count < sector) {
> > > /* Yecch */
> > > bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
> > > ...
> > > Folks, just which buffer flags do we want to preserve in this case?
>
> > Why do we want to clear any flags in there at all? To prevent
> > a storm of error messages from a buffer which has a silly block
> > number?
>
> That's the only reason I can think of. Simply scrubbing all the state
> bits is totally the wrong way of going about that, of course.

So what's the vote on this? It's a decision between clearing only the
obvious bit (BH_Dirty) on the one hand, and keeping the code as
unchanged as possible to reduce the possibility of introducing new
bugs.

But frankly I can't see any convincing argument for clearing anything
except the dirty state in this case.

--Stephen