ext2_free_inode: bit_cleared [PATCH]

Benjamin C.R. LaHaise (blah@kvack.org)
Wed, 12 Nov 1997 03:16:44 -0500 (EST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--3922184632-754779693-879322604=:8636
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 12 Nov 1997, Jean-Francois Micouleau wrote:
> On Tue, 11 Nov 1997, Benjamin C.R. LaHaise wrote:
> > On Tue, 11 Nov 1997, Nathan Bryant wrote:
> > > Okay, that's a lousy way of triggering it. Try this (you'll like it, I
> > > promise):
> > >
> > > while true; do (touch test &); (cp test test2 &); (rm test &); done
> >
> > Unfortunately it doesn't do it on my machine... :( But...

Played with it a bit on my test machine w/really slow ide drive - just
running a bunch (2+) of:
while true; do (touch test &); (rm test &); done
managed to trigger it.

Now why did this happen you ask? Well, let me tell you of the final
chapter in this bug hunt: picture, if you might, two processes - one
entering lookup and another entering unlink. Both manage to proceed to
the iget() of the same inode. Say the one in unlink manages to get mostly
done first and ends up blocking in iput() while doing a put_inode. The
other then wakes up (still in iget), discovers the inode has changed and
ends up reloading an inode with i_nlink == 0. When the iput gets done,
ext2 tries to free the inode again, leading to confusion. This happened
because of my changes to iget to get along with the locking now in iget.

Previously under 2.0.32-1 and earlier, a similar situation could occur,
but I believe it more typically involved a near-simulatenous lookup and
rename. Of course the (worse) bug that this patch initially set out to
fix was the blocking in clear_inode while the inode came back into use
problem - which could probably lead to ext2_free_inode message if the same
inode number was reallocated while the clear_inode was still proceeding
(ie the system would momentarily have two inode with the same i_ino
value). Now if this (almost) happens, we should see a 'Whee... inode
changed from under us' message. (Although everything should be okay!)

...
> previously, 2.0.31, and 2.0.32-pre1 crashed in less than 30 minutes
>
> In fact your patches helped me track down another bug in latest tulip
> driver 0.85

Kewl! The attached patch against base 2.0.32-1 should be the end of it.
Sorry about not providing a patch from the last, but... This one also
includes Nathan Bryant's fix (thanks!).

> I hope linus will make 2.0.32-pre2 with you patch and will turn to 2.0.32

Would people using nfs, smbfs, ncpfs and every other filesystem under the
moon give this (hopefully final) patch against 2.0.32-1 a test? Please
report back both successes and failures! A really good test would be
someone with a heavily loaded news server... (hint hint!) or anyone else
who has ever seen the 'ext2_free_inode: bit already cleared' message.
Thanks!

-ben

--3922184632-754779693-879322604=:8636
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ben-inode3-2.0.32-1.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.95.971112031644.8636B@as200.spellcast.com>
Content-Description:

ZGlmZiAtdXIgMi4wLjMyLTEvZHJpdmVycy9ibG9jay9tZC5jIGxpbi1iZW4v
ZHJpdmVycy9ibG9jay9tZC5jDQotLS0gMi4wLjMyLTEvZHJpdmVycy9ibG9j
ay9tZC5jCVNhdCBKdW4gMjkgMTc6MDQ6MDAgMTk5Ng0KKysrIGxpbi1iZW4v
ZHJpdmVycy9ibG9jay9tZC5jCVdlZCBOb3YgMTIgMDI6MDQ6MTYgMTk5Nw0K
QEAgLTIxNSw4ICsyMTUsMTIgQEANCiAgIH0NCiAgIA0KICAgLyogUmVtb3Zl
IGxvY2tzLiAqLw0KLSAgZm9yIChpPTA7IGk8bWRfZGV2W21pbm9yXS5uYl9k
ZXY7IGkrKykNCisgIGZvciAoaT0wOyBpPG1kX2RldlttaW5vcl0ubmJfZGV2
OyBpKyspIHsNCisgICAgbWRfZGV2W21pbm9yXS5kZXZpY2VzW2ldLmlub2Rl
LT5pX2xvY2sgPSAxOw0KICAgICBjbGVhcl9pbm9kZSAobWRfZGV2W21pbm9y
XS5kZXZpY2VzW2ldLmlub2RlKTsNCisgICAgbWRfZGV2W21pbm9yXS5kZXZp
Y2VzW2ldLmlub2RlLT5pX2xvY2sgPSAwOw0KKyAgICB3YWtlX3VwKCZtZF9k
ZXZbbWlub3JdLmRldmljZXNbaV0uaW5vZGUtPmlfd2FpdCk7DQorICB9DQog
ICANCiAgIG1kX2RldlttaW5vcl0ub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