Skip to contentSkip to conversation

one-liner fix for bforget() honoring BH_Protected; was: Re: Patch (repost): cramfs memory corruption fix

PATCH Adam J. Richter 1 participant 1 message Jan 11, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines

From: "David L. Parsley" <[email protected]>

Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Adam J. Richter

This sounds like a bug that I posted a fix for a long time ago.
cramfs calls bforget on the superblock area, destroying that block of the ramdisk, even when the ramdisk does not contain a cramfs file system. Normally, bforget is called on block that really can be trashed, such as blocks release by truncate or unlink.

Quoted 6 lines
Quoted 3 lines

I'd really prefer just not letting bforget() touch BH_Protected buffers. bforget() is also used by other things than unlink/truncate: it's used by various partition codes etc, and it's used by the raid logic.

Yup, I backed out Adam's one-liner in favor of the attached one-liner. Tested on 2.4.0, but should patch cleanly to just about anything. ;-)

Applying Linus's patch is fine, but I think my patch should also
be applied (in addition), although for a less important reason. The bforget in cramfs is going to force unnecessary device IO if cramfs is in the list of file systems that you are trying to detect when mounting a file system from a physical device.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[email protected]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America

fax +1 408 261-6631 "Free Software For The Rest Of Us."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/