diff options
author | 2025-03-06 14:08:27 +0100 | |
---|---|---|
committer | 2025-03-07 12:31:04 +0100 | |
commit | b6b227e36b5ad878260f5a3a1838f2d79d5e68e9 (patch) | |
tree | becb7686669524fb4e50a3df8bfb70338f238998 | |
parent | Merge branch 'x86-mixed-mode' into efi/next (diff) | |
download | wireguard-linux-b6b227e36b5ad878260f5a3a1838f2d79d5e68e9.tar.xz wireguard-linux-b6b227e36b5ad878260f5a3a1838f2d79d5e68e9.zip |
efivarfs: Revert "allow creation of zero length files"
As agreed with the fwupd/LVFS maintainer, this reverts commit
fc20737d8b85691ecabab3739ed7d06c9b7bc00f again for the v6.15 cycle,
leaving them sufficient time to roll out a fix for the issue that the
reverted commit works around.
Link: https://lore.kernel.org/all/63837c36eceaf8cf2af7933dccca54ff4dd9f30d.camel@HansenPartnership.com/
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r-- | fs/efivarfs/file.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index c294a8fc566d..cb1b6d0c3454 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -57,11 +57,10 @@ static ssize_t efivarfs_file_write(struct file *file, if (bytes == -ENOENT) { /* - * FIXME: temporary workaround for fwupdate, signal - * failed write with a 1 to keep created but not - * written files + * zero size signals to release that the write deleted + * the variable */ - i_size_write(inode, 1); + i_size_write(inode, 0); } else { i_size_write(inode, datasize + sizeof(attributes)); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); @@ -125,8 +124,7 @@ static int efivarfs_file_release(struct inode *inode, struct file *file) struct efivar_entry *var = inode->i_private; inode_lock(inode); - /* FIXME: temporary work around for fwupdate */ - var->removed = (--var->open_count == 0 && i_size_read(inode) == 1); + var->removed = (--var->open_count == 0 && i_size_read(inode) == 0); inode_unlock(inode); if (var->removed) |