30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
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;
|