[go: up one dir, main page]

Bug 930599 - NCQ + TRIM corruption on Samsung SSD
Summary: NCQ + TRIM corruption on Samsung SSD
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Kernel (show other bugs)
Version: 13.2
Hardware: All openSUSE 13.2
: P5 - None : Major (vote)
Target Milestone: ---
Assignee: Jean Delvare
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-12 17:04 UTC by Ivan Topolsky
Modified: 2015-08-14 09:12 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
ignore queued trim on samsung 840 evo (514 bytes, patch)
2015-05-12 17:04 UTC, Ivan Topolsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Topolsky 2015-05-12 17:04:37 UTC
Created attachment 633997 [details]
ignore queued trim on samsung 840 evo

As reported by several sources:
- http://www.overclock.net/t/1507897/samsung-840-evo-read-speed-drops-on-old-written-data-in-the-drive/2640#post_23827674
- http://www.jdgleaver.co.uk/blog/2015/05/01/samsung_840_evo_latest_firmware_breaks_fstrim_a_possible_solution.html
- http://hardware.slashdot.org/comments.pl?sid=7393561&cid=49654861
- https://bugs.launchpad.net/ubuntu/+source/fstrim/+bug/1449005

...the latest firmware of the Samsung 840 EVO wrongly reports that the SSD supports queued TRIM.

If left as is, data corruption happens upon any invocation of fstrim or attempts to mount a filesystem with discard.

Solutions are either:
- disable ncq
- disable trim
- patch libatacore.c so that libata ignores the advertising of queued TRIM.

(see patch).

One of the comment on launchpad reports that upstream 4.0.x kernel is having similar modifications:
- https://bugs.launchpad.net/ubuntu/+source/fstrim/+bug/1449005/comments/5
Comment 1 Takashi Iwai 2015-05-21 13:28:14 UTC
850 Evo was already covered by bsc#926156.  Now the upstream blacklisted the whole 8xx series by the commit 9a9324d3969678d44b330e1230ad2c8ae67acf81
  libata: Blacklist queued TRIM on all Samsung 800-series

I backported this to openSUSE-13.2 branch.  For FACTORY, it'll be fixed later through the stable tree.
Comment 3 Ivan Topolsky 2015-05-22 22:21:53 UTC
> 850 Evo was already covered by bsc#926156.

Sorry I didn't knew:
> You are not authorized to access bug #926156. 

> Now the upstream blacklisted the whole 8xx series 
Yup, it was mentionned in some of the sources I cited.

> I backported this to openSUSE-13.2 branch.  For FACTORY, it'll be fixed later through the stable tree.
Thank you very much for your work.
Comment 6 Jean Delvare 2015-05-26 07:38:12 UTC
It turns out that support for queued trim was only added in kernel v3.12 so openSUSE 13.1 is not affected by this bug.
Comment 7 Jiri Slaby 2015-05-26 14:02:25 UTC
I added the patch to stable 3.12 too.
Comment 8 Jean Delvare 2015-05-26 14:05:29 UTC
Perfect, thanks Jiri.
Comment 9 Swamp Workflow Management 2015-07-31 08:17:09 UTC
SUSE-SU-2015:1324-1: An update that solves 11 vulnerabilities and has 63 fixes is now available.

Category: security (important)
Bug References: 854817,854824,858727,866911,867362,895814,903279,907092,908491,915183,917630,918618,921430,924071,924526,926369,926953,927455,927697,927786,928131,929475,929696,929879,929974,930092,930399,930579,930599,930972,931124,931403,931538,931620,931860,931988,932348,932793,932897,932898,932899,932900,932967,933117,933429,933637,933896,933904,933907,934160,935083,935085,935088,935174,935542,935881,935918,936012,936423,936445,936446,936502,936556,936831,936875,937032,937087,937609,937612,937613,937616,938022,938023,938024
CVE References: CVE-2014-9728,CVE-2014-9729,CVE-2014-9730,CVE-2014-9731,CVE-2015-1805,CVE-2015-3212,CVE-2015-4036,CVE-2015-4167,CVE-2015-4692,CVE-2015-5364,CVE-2015-5366
Sources used:
SUSE Linux Enterprise Workstation Extension 12 (src):    kernel-default-3.12.44-52.10.1
SUSE Linux Enterprise Software Development Kit 12 (src):    kernel-docs-3.12.44-52.10.3, kernel-obs-build-3.12.44-52.10.1
SUSE Linux Enterprise Server 12 (src):    kernel-default-3.12.44-52.10.1, kernel-source-3.12.44-52.10.1, kernel-syms-3.12.44-52.10.1, kernel-xen-3.12.44-52.10.1
SUSE Linux Enterprise Module for Public Cloud 12 (src):    kernel-ec2-3.12.44-52.10.1
SUSE Linux Enterprise Live Patching 12 (src):    kgraft-patch-SLE12_Update_6-1-2.1
SUSE Linux Enterprise Desktop 12 (src):    kernel-default-3.12.44-52.10.1, kernel-source-3.12.44-52.10.1, kernel-syms-3.12.44-52.10.1, kernel-xen-3.12.44-52.10.1
Comment 10 Forgotten User w4XUsT47_R 2015-08-11 12:56:43 UTC
Hi

I know this bug report is fixed, but I am having issues with the same Samsung drives on openSUSE 13.2 with kernel 3.16. If I upgrade to kernel 4.1.4 the the issue goes away, but I cannot use kernel 4.1.4 as I cannot get VMWare workstation to work with kernel 4.1.4

I have the following drive: 
Samsung SSD 840 EVO 1TB 
Firmware Version: EXT0DB6Q

If I boot with kernel 4.1.4 it reports in dmesg that ncq trim is disabled and the drive works 100%

If I boot with with kernel 3.16.7-21 then it does not say the ncq trim is disabled in dmesg and I get file system corruption.

Can someone please tell me which version of the 3.16 kernel has the backported pacth.

Thanx

Johan
Comment 11 Takashi Iwai 2015-08-11 13:01:04 UTC
(In reply to Johan Kotze from comment #10)
> Hi
> 
> I know this bug report is fixed, but I am having issues with the same
> Samsung drives on openSUSE 13.2 with kernel 3.16. If I upgrade to kernel
> 4.1.4 the the issue goes away, but I cannot use kernel 4.1.4 as I cannot get
> VMWare workstation to work with kernel 4.1.4
> 
> I have the following drive: 
> Samsung SSD 840 EVO 1TB 
> Firmware Version: EXT0DB6Q
> 
> If I boot with kernel 4.1.4 it reports in dmesg that ncq trim is disabled
> and the drive works 100%
> 
> If I boot with with kernel 3.16.7-21 then it does not say the ncq trim is
> disabled in dmesg and I get file system corruption.
> 
> Can someone please tell me which version of the 3.16 kernel has the
> backported pacth.

It has already, but maybe it's not included in the last release.  Try KOTD instead:
  http://download.opensuse.org/repositories/Kernel:/openSUSE-13.2/standard/
Comment 12 Forgotten User w4XUsT47_R 2015-08-11 13:15:13 UTC
I checked the file drivers/ata/libata-core.c and the entry for the Samsung drives are not in there. So somewhere along the line the entry must have gone missing again.
Comment 13 Takashi Iwai 2015-08-11 13:21:04 UTC
(In reply to Johan Kotze from comment #12)
> I checked the file drivers/ata/libata-core.c and the entry for the Samsung
> drives are not in there. So somewhere along the line the entry must have
> gone missing again.

You must have looked at the wrong version.  The fix is in openSUSE-13.2 git branch, commit 2011d88005213382d4e0013036ebfe1927d3ae96.
Comment 14 Forgotten User w4XUsT47_R 2015-08-11 14:31:51 UTC
Hi

Thanx. I downloaded the KOTD kernel and it works now. Should the fix not also be in the openSUSE Update repo ? The latest kernel that is in the update repo is 3.16.7-21 and it does not have the pacth
Comment 15 Takashi Iwai 2015-08-11 14:55:38 UTC
(In reply to Johan Kotze from comment #14)
> Hi
> 
> Thanx. I downloaded the KOTD kernel and it works now. Should the fix not
> also be in the openSUSE Update repo ? The latest kernel that is in the
> update repo is 3.16.7-21 and it does not have the pacth

It will be included once when the update is released in future.
Comment 16 Swamp Workflow Management 2015-08-14 09:12:48 UTC
openSUSE-SU-2015:1382-1: An update that solves 21 vulnerabilities and has 8 fixes is now available.

Category: security (important)
Bug References: 907092,907714,915517,916225,919007,919596,921769,922583,925567,925961,927786,928693,929624,930488,930599,931580,932348,932844,933934,934202,934397,934755,935530,935542,935705,935913,937226,938976,939394
CVE References: CVE-2014-9728,CVE-2014-9729,CVE-2014-9730,CVE-2014-9731,CVE-2015-1420,CVE-2015-1465,CVE-2015-2041,CVE-2015-2922,CVE-2015-3212,CVE-2015-3290,CVE-2015-3339,CVE-2015-3636,CVE-2015-4001,CVE-2015-4002,CVE-2015-4003,CVE-2015-4036,CVE-2015-4167,CVE-2015-4692,CVE-2015-4700,CVE-2015-5364,CVE-2015-5366
Sources used:
openSUSE 13.2 (src):    bbswitch-0.8-3.11.1, cloop-2.639-14.11.1, crash-7.0.8-11.1, hdjmod-1.28-18.12.1, ipset-6.23-11.1, kernel-debug-3.16.7-24.1, kernel-default-3.16.7-24.1, kernel-desktop-3.16.7-24.1, kernel-docs-3.16.7-24.2, kernel-ec2-3.16.7-24.1, kernel-obs-build-3.16.7-24.2, kernel-obs-qa-3.16.7-24.1, kernel-obs-qa-xen-3.16.7-24.1, kernel-pae-3.16.7-24.1, kernel-source-3.16.7-24.1, kernel-syms-3.16.7-24.1, kernel-vanilla-3.16.7-24.1, kernel-xen-3.16.7-24.1, pcfclock-0.44-260.11.1, vhba-kmp-20140629-2.11.1, xen-4.4.2_06-25.1, xtables-addons-2.6-11.1