Side-note about bug in hio driver 2.1.0.26 (#1: bio_endio() shim macro
sets bi_error field).  This turns out NOT the cause of this data
corruption bug per James' testing, but should be corrected (both in the
upstream driver and Ubuntu).

The idea behind this change is correct (the macro shim should indeed set
bi_error) but the implementation is unsafe:

 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
-#define bio_endio(bio, errors) bio_endio(bio)
+#define bio_endio(bio, errors) \
+       bio->bi_error = errors; \
+       bio_endio(bio)
 #endif

Instead, the macro content must resolve to a single expression, e.g.:

+#define bio_endio(bio, errors) \
+       do { bio->bi_error = errors; bio_endio(bio); } while (0)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1638700

Title:
  hio: SSD data corruption under stress test

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1638700/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to