flashcache is not usable on kernel version 4.8 and later

Bug #1714185 reported by Stefan Bader
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flashcache (Debian)
Fix Released
Unknown
flashcache (Ubuntu)
Fix Released
High
Stefan Bader
Xenial
Fix Released
Medium
Stefan Bader
Zesty
Fix Released
High
Stefan Bader

Bug Description

SRU justification:

Impact:
The flashcache DKMS module is building but due to an incomplete adaptation for the bi_op/bi_opf split the resulting device-mapper logical volume is not properly writing back data to the backing device.
!!! It is possible to write to the volume but the data is LOST !!!

Fix:
When setting up internal device-mapper IO structures we *must* also initialize bi_op_flags. At least when the structure is on the stack and is set up with individual assignments. Maybe it would not be required for the { ... } form but better be explicit in all cases.

Testcase:
- prereq: two block devices (disks or partitions), for testing this can also
  be loop devices. also need flashcache-utils and flashcache-dkms
- run "sudo flashcache-create -p back <name> <cache-dev> <backing-dev>"
- run "sudo mkfs.ext4 /dev/mapper/<name>"
- run "sudo fsck -f /dev/mapper/<name>"
- run "sudo dmsetup remove <name>" (this can take a bit)
- run "sudo fsck -f <backing-dev>"

Regression Potential:
None. The fix is only properly initializing otherwise uninitialized struct fields.

Revision history for this message
Stefan Bader (smb) wrote :
tags: added: patch
Stefan Bader (smb)
Changed in flashcache (Ubuntu Xenial):
assignee: nobody → Stefan Bader (smb)
importance: Undecided → Medium
status: New → In Progress
Changed in flashcache (Ubuntu Zesty):
assignee: nobody → Stefan Bader (smb)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flashcache - 3.1.3+git20150701-5ubuntu1

---------------
flashcache (3.1.3+git20150701-5ubuntu1) artful; urgency=medium

  * Initialize bi_op_flags in dm_io_request structures (LP: #1714185).
  * Fix DKMS compile for 4.13+ kernels (LP: #1706426).

 -- Stefan Bader <email address hidden> Wed, 30 Aug 2017 16:49:59 +0200

Changed in flashcache (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

+1, please be sure to forward this upstream/Debian as well.

Changed in flashcache (Ubuntu Zesty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Stefan, or anyone else affected,

Accepted flashcache into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flashcache/3.1.3+git20150701-5ubuntu0.17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

description: updated
Revision history for this message
Stefan Bader (smb) wrote :
Changed in flashcache (Debian):
status: Unknown → New
Revision history for this message
Stefan Bader (smb) wrote :

Verification in Zesty:
- Installed flashcache-dkms, flashcache-utils from updates
  - DKMS build ok
- Installed/copied stress-ng and regression test script
- Test failed (guest stopped responding)
- Installed flashcache-dkms, flashcache-utils from proposed:
  - DKMS build ok (3.1.3+git20150701-5ubuntu0.17.04.1)
  - flashcache, 3.1.3+git20150701, 4.10.0-34-generic, x86_64: installed
- Test passed

II: Checking for 5G available disk space...OK
II: Creating loop files:
II: - backing-18535.img...OK
II: - cache-18535.img...OK
II: Connecting to loop devices:
II: - backing-18535.img -> /dev/loop0...OK
II: - cache-18535.img -> /dev/loop1...OK
II: Loading flashcache module...OK
II: Creating flashcache logical device...
cachedev fctgt, ssd_devname /dev/loop1, disk_devname /dev/loop0
 cache mode WRITE_BACK block_size 8, md_block_size 8,
 cache_size 2097152
Flashcache metadata will use 5MB of your 1997MB main memory
OK
II: Creating mount-point...OK
II: Create filesystem on flashcache target...OK
II: Mounting flachcache target to fcmnt-18535...OK
II: Testing...
stress-ng: info: [18605] dispatching hogs: 2 hdd
stress-ng: info: [18605] successful run completed in 322.20s (5 mins, 22.20 secs)
II: Unmounting fcmnt-18535...
II: Deleting flashcache target...
II: Testing integrity of backing device...
fsck from util-linux 2.29
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop0: 11/262144 files (0.0% non-contiguous), 36942/1048576 blocks
II: Removing mount directory...
II: Detaching /dev/loop1...
II: Detaching /dev/loop0...
II: Deleting file images...
PASS

tags: added: verification-done-zesty
removed: verification-needed-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted flashcache into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/flashcache/3.1.3+git20150701-2ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in flashcache (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flashcache - 3.1.3+git20150701-5ubuntu0.17.04.1

---------------
flashcache (3.1.3+git20150701-5ubuntu0.17.04.1) zesty; urgency=medium

  * Initialize bi_op_flags in dm_io_request structures (LP: #1714185).

 -- Stefan Bader <email address hidden> Thu, 31 Aug 2017 10:17:56 +0200

Changed in flashcache (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for flashcache has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Stefan Bader (smb) wrote :

~$ uname -a
Linux lam-maas01 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

~$ dkms status
flashcache, 3.1.3+git20150701, 4.10.0-35-generic, x86_64: installed
flashcache, 3.1.3+git20150701, 4.13.0-11-generic, x86_64: installed
flashcache, 3.1.3+git20150701, 4.4.0-96-generic, x86_64: installed

~$ ./test_flashcache.sh
II: Checking for 6G available disk space...OK
II: Creating loop files:
II: - backing-7080.img...OK
II: - cache-7080.img...OK
II: Connecting to loop devices:
II: - backing-7080.img -> /dev/loop0...OK
II: - cache-7080.img -> /dev/loop1...OK
II: Loading flashcache module...OK
II: Creating flashcache logical device...
cachedev fctgt, ssd_devname /dev/loop1, disk_devname /dev/loop0 cache mode WRITE_BACK
block_size 8, md_block_size 8, cache_size 2097152
Flashcache metadata will use 5MB of your 1997MB main memory
OK
II: Creating mount-point...OK
II: Create filesystem on flashcache target...OK
II: Mounting flachcache target to fcmnt-7080...OK
II: Testing...
stress-ng: info: [7152] dispatching hogs: 2 hdd
stress-ng: info: [7152] cache allocate: default cache size: 4096K
stress-ng: info: [7152] successful run completed in 317.52s (5 mins, 17.52 secs)
II: Unmounting fcmnt-7080...
II: Deleting flashcache target...
II: Testing integrity of backing device...
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop0: 11/327680 files (0.0% non-contiguous), 55902/1310720 blocks
II: Removing mount directory...
II: Detaching /dev/loop1...
II: Detaching /dev/loop0...
II: Deleting file images...
PASS

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Changed in flashcache (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package flashcache - 3.1.3+git20150701-2ubuntu3

---------------
flashcache (3.1.3+git20150701-2ubuntu3) xenial; urgency=medium

  * Backport compat code for kernel 4.8 (LP: #1662108)
  * Initialize bi_op_flags in dm_io_request structures (LP: #1714185)
  * Fix DKMS compile for 4.13+ kernels (LP: #1706426)

 -- Stefan Bader <email address hidden> Mon, 06 Feb 2017 17:25:15 +0100

Changed in flashcache (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.