aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/apei/erst.c4
-rw-r--r--drivers/firmware/efivars.c17
-rw-r--r--fs/pstore/inode.c3
-rw-r--r--fs/pstore/ram.c2
-rw-r--r--include/linux/pstore.h2
5 files changed, 14 insertions, 14 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index e4d9d24eb73d..0bd6ae4a899f 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -938,7 +938,7 @@ static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
938 u64 *id, unsigned int part, 938 u64 *id, unsigned int part,
939 size_t size, struct pstore_info *psi); 939 size_t size, struct pstore_info *psi);
940static int erst_clearer(enum pstore_type_id type, u64 id, 940static int erst_clearer(enum pstore_type_id type, u64 id,
941 struct pstore_info *psi); 941 struct timespec time, struct pstore_info *psi);
942 942
943static struct pstore_info erst_info = { 943static struct pstore_info erst_info = {
944 .owner = THIS_MODULE, 944 .owner = THIS_MODULE,
@@ -1102,7 +1102,7 @@ static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
1102} 1102}
1103 1103
1104static int erst_clearer(enum pstore_type_id type, u64 id, 1104static int erst_clearer(enum pstore_type_id type, u64 id,
1105 struct pstore_info *psi) 1105 struct timespec time, struct pstore_info *psi)
1106{ 1106{
1107 return erst_clear(id); 1107 return erst_clear(id);
1108} 1108}
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index fbe9202c2678..3803621c0d45 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -747,24 +747,25 @@ static int efi_pstore_write(enum pstore_type_id type,
747}; 747};
748 748
749static int efi_pstore_erase(enum pstore_type_id type, u64 id, 749static int efi_pstore_erase(enum pstore_type_id type, u64 id,
750 struct pstore_info *psi) 750 struct timespec time, struct pstore_info *psi)
751{ 751{
752 char stub_name[DUMP_NAME_LEN]; 752 char name[DUMP_NAME_LEN];
753 efi_char16_t efi_name[DUMP_NAME_LEN]; 753 efi_char16_t efi_name[DUMP_NAME_LEN];
754 efi_guid_t vendor = LINUX_EFI_CRASH_GUID; 754 efi_guid_t vendor = LINUX_EFI_CRASH_GUID;
755 struct efivars *efivars = psi->data; 755 struct efivars *efivars = psi->data;
756 struct efivar_entry *entry, *found = NULL; 756 struct efivar_entry *entry, *found = NULL;
757 int i; 757 int i;
758 758
759 sprintf(stub_name, "dump-type%u-%u-", type, (unsigned int)id); 759 sprintf(name, "dump-type%u-%u-%lu", type, (unsigned int)id,
760 time.tv_sec);
760 761
761 spin_lock(&efivars->lock); 762 spin_lock(&efivars->lock);
762 763
763 for (i = 0; i < DUMP_NAME_LEN; i++) 764 for (i = 0; i < DUMP_NAME_LEN; i++)
764 efi_name[i] = stub_name[i]; 765 efi_name[i] = name[i];
765 766
766 /* 767 /*
767 * Clean up any entries with the same name 768 * Clean up an entry with the same name
768 */ 769 */
769 770
770 list_for_each_entry(entry, &efivars->list, list) { 771 list_for_each_entry(entry, &efivars->list, list) {
@@ -775,9 +776,6 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id,
775 if (utf16_strncmp(entry->var.VariableName, efi_name, 776 if (utf16_strncmp(entry->var.VariableName, efi_name,
776 utf16_strlen(efi_name))) 777 utf16_strlen(efi_name)))
777 continue; 778 continue;
778 /* Needs to be a prefix */
779 if (entry->var.VariableName[utf16_strlen(efi_name)] == 0)
780 continue;
781 779
782 /* found */ 780 /* found */
783 found = entry; 781 found = entry;
@@ -785,6 +783,7 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id,
785 &entry->var.VendorGuid, 783 &entry->var.VendorGuid,
786 PSTORE_EFI_ATTRIBUTES, 784 PSTORE_EFI_ATTRIBUTES,
787 0, NULL); 785 0, NULL);
786 break;
788 } 787 }
789 788
790 if (found) 789 if (found)
@@ -823,7 +822,7 @@ static int efi_pstore_write(enum pstore_type_id type,
823} 822}
824 823
825static int efi_pstore_erase(enum pstore_type_id type, u64 id, 824static int efi_pstore_erase(enum pstore_type_id type, u64 id,
826 struct pstore_info *psi) 825 struct timespec time, struct pstore_info *psi)
827{ 826{
828 return 0; 827 return 0;
829} 828}
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 4ab572e6d277..4300af654710 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -175,7 +175,8 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
175 struct pstore_private *p = dentry->d_inode->i_private; 175 struct pstore_private *p = dentry->d_inode->i_private;
176 176
177 if (p->psi->erase) 177 if (p->psi->erase)
178 p->psi->erase(p->type, p->id, p->psi); 178 p->psi->erase(p->type, p->id, dentry->d_inode->i_ctime,
179 p->psi);
179 180
180 return simple_unlink(dir, dentry); 181 return simple_unlink(dir, dentry);
181} 182}
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 1a4f6da58eab..749693fcb75a 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -237,7 +237,7 @@ static int notrace ramoops_pstore_write_buf(enum pstore_type_id type,
237} 237}
238 238
239static int ramoops_pstore_erase(enum pstore_type_id type, u64 id, 239static int ramoops_pstore_erase(enum pstore_type_id type, u64 id,
240 struct pstore_info *psi) 240 struct timespec time, struct pstore_info *psi)
241{ 241{
242 struct ramoops_context *cxt = psi->data; 242 struct ramoops_context *cxt = psi->data;
243 struct persistent_ram_zone *prz; 243 struct persistent_ram_zone *prz;
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index ee3034a40884..f6e93362d259 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -60,7 +60,7 @@ struct pstore_info {
60 unsigned int part, const char *buf, size_t size, 60 unsigned int part, const char *buf, size_t size,
61 struct pstore_info *psi); 61 struct pstore_info *psi);
62 int (*erase)(enum pstore_type_id type, u64 id, 62 int (*erase)(enum pstore_type_id type, u64 id,
63 struct pstore_info *psi); 63 struct timespec time, struct pstore_info *psi);
64 void *data; 64 void *data;
65}; 65};
66 66