From 546088989a849ed649681dbd40440edb97a7454c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 29 Apr 2018 13:49:23 +0200 Subject: [PATCH] 3.18-stable patches added patches: kobject-don-t-use-warn-for-registration-failures.patch scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch --- ...t-use-warn-for-registration-failures.patch | 47 +++++++++++++++++++ ...-drive-while-sanitize-is-in-progress.patch | 36 ++++++++++++++ queue-3.18/series | 2 + 3 files changed, 85 insertions(+) create mode 100644 queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch create mode 100644 queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch diff --git a/queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch b/queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch new file mode 100644 index 00000000000..7b430e31a4a --- /dev/null +++ b/queue-3.18/kobject-don-t-use-warn-for-registration-failures.patch @@ -0,0 +1,47 @@ +From 3e14c6abbfb5c94506edda9d8e2c145d79375798 Mon Sep 17 00:00:00 2001 +From: Dmitry Vyukov +Date: Wed, 11 Apr 2018 17:22:43 +0200 +Subject: kobject: don't use WARN for registration failures + +From: Dmitry Vyukov + +commit 3e14c6abbfb5c94506edda9d8e2c145d79375798 upstream. + +This WARNING proved to be noisy. The function still returns an error +and callers should handle it. That's how most of kernel code works. +Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs. + +Signed-off-by: Dmitry Vyukov +Reported-by: syzbot+209c0f67f99fec8eb14b@syzkaller.appspotmail.com +Reported-by: syzbot+7fb6d9525a4528104e05@syzkaller.appspotmail.com +Reported-by: syzbot+2e63711063e2d8f9ea27@syzkaller.appspotmail.com +Reported-by: syzbot+de73361ee4971b6e6f75@syzkaller.appspotmail.com +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + lib/kobject.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +--- a/lib/kobject.c ++++ b/lib/kobject.c +@@ -234,14 +234,12 @@ static int kobject_add_internal(struct k + + /* be noisy on error issues */ + if (error == -EEXIST) +- WARN(1, "%s failed for %s with " +- "-EEXIST, don't try to register things with " +- "the same name in the same directory.\n", +- __func__, kobject_name(kobj)); ++ pr_err("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n", ++ __func__, kobject_name(kobj)); + else +- WARN(1, "%s failed for %s (error: %d parent: %s)\n", +- __func__, kobject_name(kobj), error, +- parent ? kobject_name(parent) : "'none'"); ++ pr_err("%s failed for %s (error: %d parent: %s)\n", ++ __func__, kobject_name(kobj), error, ++ parent ? kobject_name(parent) : "'none'"); + } else + kobj->state_in_sysfs = 1; + diff --git a/queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch b/queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch new file mode 100644 index 00000000000..7aa7ddb1b6c --- /dev/null +++ b/queue-3.18/scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch @@ -0,0 +1,36 @@ +From 505aa4b6a8834a2300971c5220c380c3271ebde3 Mon Sep 17 00:00:00 2001 +From: Mahesh Rajashekhara +Date: Tue, 17 Apr 2018 17:03:12 +0530 +Subject: scsi: sd: Defer spinning up drive while SANITIZE is in progress + +From: Mahesh Rajashekhara + +commit 505aa4b6a8834a2300971c5220c380c3271ebde3 upstream. + +A drive being sanitized will return NOT READY / ASC 0x4 / ASCQ +0x1b ("LOGICAL UNIT NOT READY. SANITIZE IN PROGRESS"). + +Prevent spinning up the drive until this condition clears. + +[mkp: tweaked commit message] + +Signed-off-by: Mahesh Rajashekhara +Cc: +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -1848,6 +1848,8 @@ sd_spinup_disk(struct scsi_disk *sdkp) + break; /* standby */ + if (sshdr.asc == 4 && sshdr.ascq == 0xc) + break; /* unavailable */ ++ if (sshdr.asc == 4 && sshdr.ascq == 0x1b) ++ break; /* sanitize in progress */ + /* + * Issue command to spin up drive when not ready + */ diff --git a/queue-3.18/series b/queue-3.18/series index 58491b82908..e3de4c65c82 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -18,3 +18,5 @@ alsa-seq-oss-fix-unbalanced-use-lock-for-synth-midi-device.patch mtd-cfi-cmdset_0001-do-not-allow-read-write-to-suspend-erase-block.patch mtd-cfi-cmdset_0001-workaround-micron-erase-suspend-bug.patch mtd-cfi-cmdset_0002-do-not-allow-read-write-to-suspend-erase-block.patch +kobject-don-t-use-warn-for-registration-failures.patch +scsi-sd-defer-spinning-up-drive-while-sanitize-is-in-progress.patch -- 2.47.3