checking write_cached_data return status inside _release and _flush?
hi!
i experienced some corruption of data on flash memories i am using, and discovered that this is related to these functions in mtdblock.c:
static int mtdblock_release(struct mtd_blktrans_dev *mbd) static int mtdblock_flush(struct mtd_blktrans_dev *dev)
not checking the return value of the function:
write_cached_data(mtdblk)
i fixed that by checking the return value inside a while cycle but is there any particular reason the original code is written that way?
Thank you.
Signature · 8 lines
Massimiliano Galanti -IM----------------------- MSN: [email protected] Yahoo: massimilianogalanti ICQ: 227544335 Skype: massimilianogalanti --------------------------
Quoted 7 lines · Massimiliano Galanti
i experienced some corruption of data on flash memories i am using, and discovered that this is related to these functions in
mtdblock.c:static int
mtdblock_release(struct mtd_blktrans_dev *mbd)static intmtdblock_flush(struct mtd_blktrans_dev *dev)
Quoted 6 lines
not checking the return value of the function:
write_cached_data(mtdblk)i fixed that by checking the return value inside a while cycle but is there any particular reason the original code is written that way?
Sounds like a plain bug. Can you send a patch?
Jörn
Signature · 3 lines
If you're willing to restrict the flexibility of your approach, you can almost always do something better. -- John Carmack