[kernel] r19938 - in dists/sid/linux/debian: . patches patches/bugfix/all patches/debian

Ben Hutchings benh at alioth.debian.org
Sat Mar 23 03:56:59 UTC 2013


Author: benh
Date: Sat Mar 23 03:56:59 2013
New Revision: 19938

Log:
efivars: Adjust the size checks

- 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)

Added:
   dists/sid/linux/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch
   dists/sid/linux/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Fri Mar 22 20:15:09 2013	(r19937)
+++ dists/sid/linux/debian/changelog	Sat Mar 23 03:56:59 2013	(r19938)
@@ -103,6 +103,8 @@
     - 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 @@
     module, as we now have a real fix for #701784
   * [rt] Update to 3.2.40-rt60
 
- -- Ben Hutchings <ben at decadent.org.uk>  Fri, 22 Mar 2013 19:38:42 +0000
+ -- Ben Hutchings <ben at decadent.org.uk>  Sat, 23 Mar 2013 03:54:34 +0000
 
 linux (3.2.39-2) unstable; urgency=high
 

Added: dists/sid/linux/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch	Sat Mar 23 03:56:59 2013	(r19938)
@@ -0,0 +1,49 @@
+From: Ben Hutchings <ben at 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 at 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++)

Added: dists/sid/linux/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch	Sat Mar 23 03:56:59 2013	(r19938)
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben at 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;

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Fri Mar 22 20:15:09 2013	(r19937)
+++ dists/sid/linux/debian/patches/series	Sat Mar 23 03:56:59 2013	(r19938)
@@ -633,3 +633,5 @@
 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



More information about the Kernel-svn-changes mailing list