aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2013-03-23 03:56:59 +0000
committerBen Hutchings <benh@debian.org>2013-03-23 03:56:59 +0000
commit60f5e8697362f18d1ce9bf5f57d3af52c19f7b2a (patch)
treedafc61f9b1eba8def1ad627c75cdad3c68426caf
parent2ea813fe8d37a27de9d55bbce52c600b2540f2d3 (diff)
downloadkernel_replicant_linux-60f5e8697362f18d1ce9bf5f57d3af52c19f7b2a.tar.gz
kernel_replicant_linux-60f5e8697362f18d1ce9bf5f57d3af52c19f7b2a.tar.bz2
kernel_replicant_linux-60f5e8697362f18d1ce9bf5f57d3af52c19f7b2a.zip
efivars: Adjust the size checksdebian/3.2.41-1
- efivars: pstore: Do not check size when erasing variable (bug introduced in backporting) - efivars: Remove check for 50% full on write (this is more risky than what it tries to fix) svn path=/dists/sid/linux/; revision=19938
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch49
-rw-r--r--debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch29
-rw-r--r--debian/patches/series2
4 files changed, 83 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 0476071c33e3..10497ff57ff5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,8 @@ linux (3.2.41-1) unstable; urgency=low
- explicitly calculate length of VariableName
- Handle duplicate names from get_next_variable()
* efi_pstore: Introducing workqueue updating sysfs
+ * efivars: pstore: Do not check size when erasing variable
+ * efivars: Remove check for 50% full on write
* kmsg_dump: Only dump kernel log in error cases (Closes: #703386)
- kexec: remove KMSG_DUMP_KEXEC
- kmsg_dump: don't run on non-error paths by default
@@ -125,7 +127,7 @@ linux (3.2.41-1) unstable; urgency=low
module, as we now have a real fix for #701784
* [rt] Update to 3.2.40-rt60
- -- Ben Hutchings <ben@decadent.org.uk> Fri, 22 Mar 2013 19:38:42 +0000
+ -- Ben Hutchings <ben@decadent.org.uk> Sat, 23 Mar 2013 03:54:34 +0000
linux (3.2.39-2) unstable; urgency=high
diff --git a/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch b/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch
new file mode 100644
index 000000000000..9cfb27ea4fb9
--- /dev/null
+++ b/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch
@@ -0,0 +1,49 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: efivars: pstore: Do not check size when erasing variable
+Date: Sat, 23 Mar 2013 03:49:53 +0000
+
+In 3.2, unlike mainline, efi_pstore_erase() calls efi_pstore_write()
+with a size of 0, as the underlying EFI interface treats a size of 0
+as meaning deletion.
+
+This was not taken into account in my backport of commit d80a361d779a
+'efi_pstore: Check remaining space with QueryVariableInfo() before
+writing data'. The size check should be omitted when erasing.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/drivers/firmware/efivars.c
++++ b/drivers/firmware/efivars.c
+@@ -788,19 +788,21 @@ static int efi_pstore_write(enum pstore_
+
+ spin_lock_irqsave(&efivars->lock, flags);
+
+- /*
+- * Check if there is a space enough to log.
+- * size: a size of logging data
+- * DUMP_NAME_LEN * 2: a maximum size of variable name
+- */
++ if (size) {
++ /*
++ * Check if there is a space enough to log.
++ * size: a size of logging data
++ * DUMP_NAME_LEN * 2: a maximum size of variable name
++ */
+
+- status = check_var_size_locked(efivars, PSTORE_EFI_ATTRIBUTES,
+- size + DUMP_NAME_LEN * 2);
++ status = check_var_size_locked(efivars, PSTORE_EFI_ATTRIBUTES,
++ size + DUMP_NAME_LEN * 2);
+
+- if (status) {
+- spin_unlock_irqrestore(&efivars->lock, flags);
+- *id = part;
+- return -ENOSPC;
++ if (status) {
++ spin_unlock_irqrestore(&efivars->lock, flags);
++ *id = part;
++ return -ENOSPC;
++ }
+ }
+
+ for (i = 0; i < DUMP_NAME_LEN; i++)
diff --git a/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch b/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch
new file mode 100644
index 000000000000..aa6796e9fbcc
--- /dev/null
+++ b/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: efivars: Remove check for 50% full on write
+Date: Sat, 23 Mar 2013 02:18:42 +0000
+
+On my EFI-booting system (AMI firmware/Asus board), the firmware does
+not garbage-collect the variable store until it is rather more than
+50% full, and it also updates a variable at every boot. This check
+means that variable writes are guaranteed to fail after the system has
+booted more than a few hundred times.
+
+Since pstore integration is now disabled by default in Debian, we will
+not normally write that much data before rebooting and giving the
+firmware a chance to garbage-collect the variable store. Therefore,
+until the check can be restricted to known-bad systems, it seems less
+risky to disable it for now.
+
+---
+--- a/drivers/firmware/efivars.c
++++ b/drivers/firmware/efivars.c
+@@ -439,8 +439,7 @@ check_var_size_locked(struct efivars *ef
+ if (status != EFI_SUCCESS)
+ return status;
+
+- if (!storage_size || size > remaining_size || size > max_size ||
+- (remaining_size - size) < (storage_size / 2))
++ if (!storage_size || size > remaining_size || size > max_size)
+ return EFI_OUT_OF_RESOURCES;
+
+ return status;
diff --git a/debian/patches/series b/debian/patches/series
index 5696436c5a54..42e733afdada 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -633,3 +633,5 @@ bugfix/all/efivars-Fix-check-for-CONFIG_EFI_VARS_PSTORE_DEFAULT.patch
bugfix/all/efi_pstore-Introducing-workqueue-updating-sysfs.patch
bugfix/all/efivars-explicitly-calculate-length-of-VariableName.patch
bugfix/all/efivars-Handle-duplicate-names-from-get_next_variabl.patch
+bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch
+debian/efivars-remove-check-for-50-full-on-write.patch