efivarfs: Update inode modification time for successful writes
authorTony Luck <tony.luck@intel.com>
Thu, 28 May 2020 19:49:04 +0000 (12:49 -0700)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 15 Jun 2020 12:38:56 +0000 (14:38 +0200)
Some applications want to be able to see when EFI variables
have been updated.

Update the modification time for successful writes.

Reported-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20200528194905.690-2-tony.luck@intel.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
fs/efivarfs/file.c

index e9e27a271af0b003e2c2c3e01b2423504ffa72f5..4b8bc4560d70900802eb280931bef4eb9edee7f8 100644 (file)
@@ -51,6 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file,
        } else {
                inode_lock(inode);
                i_size_write(inode, datasize + sizeof(attributes));
+               inode->i_mtime = current_time(inode);
                inode_unlock(inode);
        }