diff --git a/debian/changelog b/debian/changelog index 0476071c3..10497ff57 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 Fri, 22 Mar 2013 19:38:42 +0000 + -- Ben Hutchings 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 000000000..9cfb27ea4 --- /dev/null +++ b/debian/patches/bugfix/all/efivars-pstore-do-not-check-size-when-erasing-variable.patch @@ -0,0 +1,49 @@ +From: Ben Hutchings +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 +--- +--- 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 000000000..aa6796e9f --- /dev/null +++ b/debian/patches/debian/efivars-remove-check-for-50-full-on-write.patch @@ -0,0 +1,29 @@ +From: Ben Hutchings +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 5696436c5..42e733afd 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